t2v / play2-auth

Play2.x Authentication and Authorization module
Apache License 2.0
608 stars 142 forks source link

Support optional parameters for login #175

Open tototoshi opened 8 years ago

tototoshi commented 8 years ago

Currently, OAuth2Controller#login and OAuth2Controller#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

  // 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:

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?