Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PasswordGrant fails to decode user_name #337

Open
bwiercinski opened this issue Jan 10, 2023 · 1 comment
Open

PasswordGrant fails to decode user_name #337

bwiercinski opened this issue Jan 10, 2023 · 1 comment

Comments

@bwiercinski
Copy link
Contributor

Exception in thread "main" 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$5(PasswordGrantProvider.scala:30)
	at cats.syntax.EitherOps$.leftMap$extension(either.scala:193)
	at com.ocadotechnology.sttp.oauth2.PasswordGrantProvider$.$anonfun$apply$4(PasswordGrantProvider.scala:30)
	at sttp.client3.monad.IdMonad$.map(IdMonad.scala:8)
	at sttp.monad.syntax$MonadErrorOps.map(MonadError.scala:60)
	at com.ocadotechnology.sttp.oauth2.PasswordGrantProvider$.$anonfun$apply$2(PasswordGrantProvider.scala:30)
	at sttp.monad.syntax$MonadErrorOps.flatMap(MonadError.scala:61)
	at com.ocadotechnology.sttp.oauth2.PasswordGrantProvider$.$anonfun$apply$1(PasswordGrantProvider.scala:31)
	at OauthTest$.main(OauthTest.scala:18)
	at OauthTest.main(OauthTest.scala)
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)
	at sttp.client3.monad.IdMonad$.map(IdMonad.scala:8)
	at sttp.monad.syntax$MonadErrorOps.map(MonadError.scala:60)
	at sttp.client3.internal.BodyFromResponseAs.doApply(BodyFromResponseAs.scala:24)
	at sttp.client3.internal.BodyFromResponseAs.$anonfun$apply$1(BodyFromResponseAs.scala:14)
	at sttp.monad.syntax$MonadErrorOps.map(MonadError.scala:60)
	at sttp.client3.internal.BodyFromResponseAs.apply(BodyFromResponseAs.scala:14)
	at sttp.client3.HttpURLConnectionBackend.readResponse(HttpURLConnectionBackend.scala:245)
	at sttp.client3.HttpURLConnectionBackend.$anonfun$send$1(HttpURLConnectionBackend.scala:56)
	at scala.util.Try$.apply(Try.scala:209)
	at sttp.monad.MonadError.handleError(MonadError.scala:24)
	at sttp.monad.MonadError.handleError$(MonadError.scala:23)
	at sttp.client3.monad.IdMonad$.handleError(IdMonad.scala:6)
	at sttp.client3.SttpClientException$.adjustExceptions(SttpClientException.scala:58)
	at sttp.client3.HttpURLConnectionBackend.adjustExceptions(HttpURLConnectionBackend.scala:295)
	at sttp.client3.HttpURLConnectionBackend.send(HttpURLConnectionBackend.scala:30)
	at sttp.client3.HttpURLConnectionBackend.send(HttpURLConnectionBackend.scala:22)
	at sttp.client3.FollowRedirectsBackend.sendWithCounter(FollowRedirectsBackend.scala:29)
	at sttp.client3.FollowRedirectsBackend.send(FollowRedirectsBackend.scala:24)
	at com.ocadotechnology.sttp.oauth2.PasswordGrant$.$anonfun$requestToken$1(PasswordGrant.scala:40)
	at sttp.monad.syntax$MonadErrorOps.map(MonadError.scala:60)
	at com.ocadotechnology.sttp.oauth2.PasswordGrant$.requestToken(PasswordGrant.scala:42)
	at com.ocadotechnology.sttp.oauth2.PasswordGrantProvider$.$anonfun$apply$3(PasswordGrantProvider.scala:29)
	... 6 more
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)
	... 30 more

Originally posted by @reoxu in #335 (comment)

@bwiercinski
Copy link
Contributor Author

@reoxu what authentication provider do you using? where do you try to log in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant