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

438 views Asked by At

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

3

There are 3 answers

0
rgreen13 On BEST ANSWER

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 {}
}
0
o-0 On

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

0
abhi On

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