dorinclisu / fastapi-auth0

FastAPI authentication and authorization using auth0.com
MIT License
230 stars 39 forks source link

How to authenticate Implicit Grant SPA #22

Closed luciano-buono closed 2 years ago

luciano-buono commented 2 years ago

How can I use the Implicit grant without using swagger?

I managed to get to the LogIn box and authenticate, however I need to accomplish this without swagger.

How can I do a POST request to mi API and send the implicit grant there?

dorinclisu commented 2 years ago

This is the area of frontend development and can be easily done using auth0-react or auth0-spa-js javascript packages.

luciano-buono commented 2 years ago

One of my colleagues has already done the Frontend.

He calls the Auth0 LogIn and receives a token with that. Then he sends that token (is much bigger token with information of the name of the user, email, roles, metadata, audience(that is a random string)) to my API.

As far as I understand, my API should be able to use that UserSpecific Token obtained via the LogIn Box and authenticate with that

dorinclisu commented 2 years ago

Yes that's what happens.

luciano-buono commented 2 years ago

I understood the problem here (https://auth0.com/blog/id-token-access-token-what-is-the-difference/)

I didn't know the difference between ID token and Auth token.

He was sending me ID token and i need the other one