You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use PasswordGrant against a Keycloak instance, which causes a deserialization error:
com.ocadotechnology.sttp.oauth2.common$OAuth2Exception: Client call resulted in error (200): Missing required field: DownField(user_name)
at com.ocadotechnology.sttp.oauth2.PasswordGrantProvider$.$anonfun$apply$3(PasswordGrantProvider.scala:26)
at cats.syntax.EitherOps$.leftMap$extension(either.scala:172)
at com.ocadotechnology.sttp.oauth2.PasswordGrantProvider$.$anonfun$apply$2(PasswordGrantProvider.scala:26)
...
Caused by: com.ocadotechnology.sttp.oauth2.common$Error$HttpClientError: Client call resulted in error (200): Missing required field: DownField(user_name)
at com.ocadotechnology.sttp.oauth2.common$.$anonfun$responseWithCommonError$1(common.scala:103)
at sttp.client3.MappedResponseAs.$anonfun$mapWithMetadata$1(ResponseAs.scala:91)
at sttp.client3.internal.BodyFromResponseAs.$anonfun$doApply$2(BodyFromResponseAs.scala:24)
...
Caused by: sttp.client3.DeserializationException: Missing required field: DownField(user_name)
at sttp.client3.ResponseAs$.$anonfun$deserializeWithError$1(ResponseAs.scala:201)
at sttp.client3.ResponseAs$.$anonfun$deserializeRightWithError$1(ResponseAs.scala:180)
at sttp.client3.MappedResponseAs.$anonfun$mapWithMetadata$1(ResponseAs.scala:91)
The token endpoint essentially returns the fields in OAuth2TokenResponse (plus a few others), but not the extra ones from ExtendedOAuth2TokenResponse, so I guess that's the issue here because PasswordGrant still expects an ExtendedOAuth2TokenResponse.
I'm not too familiar with the codebase yet. Would it be possible to parameterize PasswordGrant to expect a custom token response like it's already done for AuthorizationCodeGrant in #104?
Activity
kubukoz commentedon Dec 22, 2020
I guess this also relates to other types, like UserInfo - sometimes we'll need to support custom codecs.
sbrunk commentedon Jul 11, 2022
I'm trying to use
PasswordGrantagainst a Keycloak instance, which causes a deserialization error:The token endpoint essentially returns the fields in
OAuth2TokenResponse(plus a few others), but not the extra ones fromExtendedOAuth2TokenResponse, so I guess that's the issue here becausePasswordGrantstill expects anExtendedOAuth2TokenResponse.I'm not too familiar with the codebase yet. Would it be possible to parameterize
PasswordGrantto expect a custom token response like it's already done forAuthorizationCodeGrantin #104?