dorinclisu / fastapi-auth0

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

Authenticating user works from localhost, but not from domain for Single Page Application. #20

Closed Bartket closed 3 years ago

Bartket commented 3 years ago

When I create the user for my FastAPI app via localhost the page redirects me to https://localhost/docs/oauth2-redirect#access_token={token}, and everything works well.

The issue is when I deploy my application on the server, then I get NGINX 404 error. I tried messing with application settings in auth0 but got no results, I am not exactly sure what is wrong here.

Any guidance or tips would be welcome.

PS. my application is using additional prefix path {service-template-python/} I am also using authentication within APIRouter

dorinclisu commented 3 years ago

I suppose you're using nginx as reverse proxy for fastapi. Describe the setup in more detail, and especially at which point exactly in the authentication process you get the error.

Bartket commented 3 years ago

Sure,

The app is deployed on Amazon EKS as a single pod container. It uses an NGINX ingress controller.

As I typed this I think I know what is the issue. I used the wrong API Gateway service, so my app cannot communicate with "the outside world", and as a result - Auth0...

I will try this out next week I guess.