abhi
abhi

Reputation: 2148

Configuration key 'authorizationUrl' is set to null but expected STRING]

I am using securesocial master snapshot version in play framwork 2.6. The error says 'authorizationUrl' is expecting string, that is what I did. Please help if I am making any mistake. Below is my securesocial.conf file

  securesocial {

  applicationHost=localhost
  applicationPort=9000

  onLoginGoTo = /home

  onLogoutGoTo = /login

  ssl = false

  sessionTimeOut = 60

  github {
    authorizationUrl = "https://github.com/login/oauth/authorize"
    accessTokenUrl = "https://github.com/login/oauth/access_token"
    clientId = 30032e485b22d8fb97f7
    clientSecret = 1b0d88c23ff56612970ac446e972035ccafbbc3e
  }

  userpass {
    withUserNameSupport = false
    sendWelcomeEmail = true
    enableGravatarSupport = true
    signupSkipLogin = true
    tokenDuration = 60
    tokenDeleteInterval = 5
    minimumPasswordLength = 8
    enableTokenJob = true
    hasher = bcrypt
  }
}

enter image description here

Upvotes: 0

Views: 466

Answers (3)

abhi
abhi

Reputation: 2148

The error was due to securesocial.conf file. In the file I have included only github provider while the reference.conf file requires all the providers to be added. Refer this link

Upvotes: 0

rgreen13
rgreen13

Reputation: 26

Looks like the solution was found deeper down in the error. The error message points to a jar file in the cache (.ivy2/cache/ws.securesocial/securesocial_2.12/jars/securesocial_2.12-master-SNAPSHOT.jar).

I this file is unzipped, the reference.conf file becomes visible, and the authorizationUrl, etc. for oauth1Settings and oauth2Settings are set to null. Changing these to strings did the trick, but this seems like a very odd fix to have to make.

The final section of the conf file looks like the code below, where the string values were originally null values.

oauth1Settings {
    requestTokenUrl = null
    accessTokenUrl = ""
    authorizationUrl = ""
    consumerKey = null
    consumerSecret = null
}

# default settings for oauth2 providers
oauth2Settings {
    # these must always be provided for each provider
    authorizationUrl = ""
    accessTokenUrl = ""
    clientId = ""
    clientSecret = ""

    # optional
    scope = null

    # optional params maps
    authorizationUrlParams {}
    accessTokenUrlParams {}
}

Upvotes: 0

o-0
o-0

Reputation: 1789

Change it within your reference.conf file and not the securesocial.conf file; as you stated in your question.

Upvotes: 1

Related Questions