I set multiple domain for single play application, and try to authenticate with OAuth1 (twitter)
But, when I try to authenticate from
my-domain2.com, silhouette complains like this,
--------------------------------------------------------------------
OAuth1TokenSecretException: [Silhouette][CookieSecretProvider] Secret cookie doesn't exists for name: OAuth1TokenSecret
--------------------------------------------------------------------
I thought callbackURL must have 'same' host(domain) with caller, then start to find the way to set domain-dependent callbackURL parameter.
After few hours,
I found OAuth1Provider try to resolve callback url from relative path when request access token:
|
| case _ => service.retrieveRequestToken(resolveCallbackURL(settings.callbackURL)).flatMap { info => |
And it fails too.....
And I finally found!!, PlayOAuth1Service didn't use resolved url, and just use the url from settings(silhouette.conf).
|
| override def retrieveRequestToken(callbackURL: String)(implicit ec: ExecutionContext): Future[OAuth1Info] = { |
| Future(service.retrieveRequestToken(settings.callbackURL)).map(_.fold( |
| e => throw e, |
| t => OAuth1Info(t.token, t.secret))) |
| } |
Am I in the right way?
or should I solve this by other way?
Please help me...