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

"not verified" response - cognito #67

Open
JustinGuese opened this issue Jan 20, 2022 · 5 comments
Open

"not verified" response - cognito #67

JustinGuese opened this issue Jan 20, 2022 · 5 comments

Comments

@JustinGuese
Copy link

JustinGuese commented Jan 20, 2022

Hi, maybe I am missing something obvious, but when authenticating using an auth token from cognito, the fastapi-cloudauth responds with 401 {"detail": "Not verified"}

This does not refer to the user I guess, as the user is email & phone verified, but does it refer to the domain (localhost, local dev)?
How would I test my app locally then?

I hope you can point me in the right direction, as this package would be awesome to use!

@tivaliy
Copy link

tivaliy commented Jan 23, 2022

There are two types of token available in Cognito: IdToken and AccessToken. Make sure that you are using correct one.

@PsypherPunk
Copy link

Can I check which of these is considered "correct"?

We've an API Gateway in front of an app. which uses fastapi-cloudauth and the Gateway seemingly accepts either. fastapi-cloudauth, however, seems only to accept the IdToken.

Not sure if I missed something in the docs
as to why that would be or if it's configurable…?

@PsypherPunk
Copy link

Ignore me: I RTFM'd a little harder and that first example finally clicked (AccessUser for the AccessToken; CognitoClaims for the IdToken.)

@JLongley
Copy link

JLongley commented Aug 4, 2023

I've implemented the code exactly as listed in the documentation for get_current_user, but regardless of if I pass the idToken or accessToken I still receive {detail: 'Not verified'}.

@PsypherPunk
Copy link

@JLongley, can I check how you're getting the tokens? And how you're forming the requests?

I've just copy/pasted the example from the README and it's seemingly working for both ID and Access tokens.

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

4 participants