OAuth2Controller#OAuth2StateKey should be `protected val`
tototoshi opened this issue · comments
Toshiyuki Takahashi commented
When I tried to override and slightly modify the implementation of OAuth2Controller#login
, I couldn't use OAuth2StateKey in the subclass since it is private val. Should it be protected?
class MyOAuth2Controller extends OAuth2Controller {
...
// want to add some optional parameters but currently not supported.
override def login(scope: String, optionalParam: String /* 👈 */) = AsyncStack(ExecutionContextKey -> OAuthExecutionContext) { implicit request =>
implicit val ec = StackActionExecutionContext
doSomethingGood(optionalParam)
loggedIn match {
case Some(u) =>
loginSucceeded(request)
case None =>
val state = UUID.randomUUID().toString
Future.successful(
Redirect(authenticator.getAuthorizationUrl(scope, state)).withSession(
request.session + (OAuth2StateKey /* Oops, it's private ❗️ */ -> state)
)
)
}
}
Manabu Nakamura commented
I understood the motivation. I change it to protected
Manabu Nakamura commented
done, I'll publish it.