Replies: 2 comments 24 replies
-
Hi @jinserk 👋 Could you share your docker-compose configuration and the error you're getting? That would help debug the issue :) I think the problems comes from the fact that fief = FiefAsync(
"http://fief:8002",
"YOUR_CLIENT_ID",
"YOUR_CLIENT_SECRET",
) But I fear that'll break the redirection when trying to authenticate through your local machine 🤔 |
Beta Was this translation helpful? Give feedback.
-
Hey @jinserk! I've had a second thought about this routing problem between containers, and following a suggestion from the great Samuel Colvin, I may have come with a good solution. You're maybe familiar with ngrok, it's a great tool to quickly "put localhost on the internet". Said another way, you get an internet-enabled URL that gets routed to your machine. So we'll use this to enable communication between For this to work, you'll need to pull Fief latest version, 0.16.2. Then, start a ngrok http --host-header localhost:8002 8002 Notice that we add the Ngrok will output you an URL in the form fief = FiefAsync(
"https://2e44-2a02-8429-80b2-1401-14f1-2b34-8bb-df37.eu.ngrok.io",
"YOUR_CLIENT_ID",
"YOUR_CLIENT_SECRET",
) And everything should work! If you restart Ngrok, you'll get a new address. Don't forget to update it afterwards 😉 I would really like to have your feedback on this approach and if you find it viable and practical. If so, this is something I would like to add to the docs. PS: I'll also answer you on your access token problem above. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a project with
fastapi
andfief
altogether in docker-compose as different containers (namedapi
andfief
respectively), serving them in the exposed ports 8001 and 8002 respectively. I followed the instruction described in here and checked the auth successful in http://localhost:8001/docs . However, when I try/user
GET api, I've got an error that it have tried to connect 127.0.0.1:8002 -- which isfief
api calls. I gave the args ofFiefAsyc
as:but it looks like
fastapi
orauth = FiefAuth(fief, scheme)
changed thelocalhost
to127.0.0.1
. This prevents the url to go to the containerfief
via host, but redirect back to theapi
container itself inside the docker compose env. Of course I set the env vars listed in here. Do you have any idea how to resolve this?Beta Was this translation helpful? Give feedback.
All reactions