None of the registered handlers can handle the given state item



I am trying to pass UserStateItem parameter to the authenticate method of OAuth2Provider as described in the example:

def authenticate(provider: String) = Action.async { implicit request: Request[AnyContent] =>
  (socialProviderRegistry.get[SocialProvider](provider) match {
    case Some(p: OAuth2Provider with CommonSocialProfileBuilder) =>
      p.authenticate(UserStateItem(Map("url" -> ""))).flatMap {
        case Left(result) => Future.successful(result)
        case Right(StatefulAuthInfo(authInfo, userState)) => ...

The provider authenticates successfully, but the Right() statement results in the ProviderException:

None of the registered handlers can handle the given state item:

The debugger shows that both CsrfStateItemHandler and UserStateItemHandler are registered. What can possibly be missing? The CSRF state item handler settings are:

csrfStateItemHandler.expirationTime=5 minutes
csrfStateItemHandler.signer.key = "[changeme]"

(I tried to use csrfStateItemHandler.cookieName="token" but it did not solve the problem).

(Using Scala 2.12.4, Play 2.6.11, Silhouette 5.0.0)

Thank you in advance!



There was an issue in version 5.0.0. Have you tried the newest version (5.0.4)?


Thank you so much, @akkie! I upgraded to 5.0.4 and everything worked!!!