// TODO scope is optional in some services
// TODO some services have more optional parameter
def login(scope: String) = AsyncStack(ExecutionContextKey -> OAuthExecutionContext) { implicit request =>
To solve this problem, I think some changes (including API changes) is required. My idea is:
Remove the scope argument because scope is optional
OAuth2Authenticator#getAuthorizationUrl should take request instead of scope
The task of login is only redirecting to authorization url, so it is enough only to change the API of OAuth2Authenticator#getAuthorizationUrl. is this correct?
Currently,
OAuth2Controller#login
andOAuth2Controller#link
doesn't support optional parameters.https://github.com/t2v/play2-auth/blob/2e60a53b43dec74d9fa9a2456d32cda349614811/social/src/main/scala/jp/t2v/lab/play2/auth/social/core/OAuth2Controller.scala#L20-L22
To solve this problem, I think some changes (including API changes) is required. My idea is:
scope
argument because scope is optionalOAuth2Authenticator#getAuthorizationUrl
should takerequest
instead ofscope
The task of
login
is only redirecting to authorization url, so it is enough only to change the API ofOAuth2Authenticator#getAuthorizationUrl
. is this correct?