FastAPI OpenIdConnect
Hey folks, I am trying to make the following to work:
Then I visit the docs and try to use "OpenIdConnect (OAuth2, implicit)" mode, but I keep getting the following issue:
See the screenshots, I am not sure what else to try by now, I tried multiple combinations of response type, grant types (with implicit and not) ... I am just not sure what else to try by now and who is in fault here


44 Replies
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Right now such class is
from fastapi.security import OpenIdConnect
which is doing the OIDC init and callback; but I am not sure why zitadel is failnig on me
I also have a working version using introspect token https://discord.com/channels/927474939156643850/1238060845460623391/1306421754402439260 but isn't standard with the FastAPI Docs, so users can not authenticate in the Docs to interact with the API
Reason why I am trying to make it work with the built-in OpenIdConnect classUnknown User•10mo ago
Message Not Public
Sign In & Join Server To View
FastAPI has its own swagger doc where you can sign in
let me see if I can put an example project, FastAPI is important enough nowdays, even above flask I would say
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
that is there, I honestly not sure what else to change
either FastAPI is broken, or I am doing something silly in Zitadel that I am just not seeing 😐
I am in Lobby, if you feel you have 10 mins to troubleshoot with me, otherwise, I am going in circles right now
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
copy+pasting!
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
checking the GUI, that would require me to pass client ID and Secret
The idea is that users can use their zitadel account to authenticate in the API, without having to provision client ID and secret, no?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
interesting, what is the point of
OpenIdConnect
? I know very little of python, if any, first time dealing with the ecosystemUnknown User•10mo ago
Message Not Public
Sign In & Join Server To View
what a cluster mess! It is probably worth adding it to the official docs; it seems that fast API is predominant nowadays
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
is there? ppfff I missed the docs then, let me try your setup in a few mins
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
would that work with OidcConnect? The werid thing is, I passed the client anyway
for real ... I still dont know which pkg manager or wahtever thingy to use
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
and some dev absolute imports taht didnt work for me ...
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
that is what I see

Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
it didnt
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
nice I see the token now
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
so now I can call the introspect with it I am guessing?
hopefully https://discord.com/channels/927474939156643850/1238060845460623391/1306421754402439260 it is correct, unless you have some nicer version
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
btw, the oidc connect just work fine, I think that was the missing piece
or rather, the PKCE part :facepalm:
IT WORKS!
NICE!
just one freaking config .... man, I feel some docs under Zitadel would be amazing, for my future self that will definitely forget this
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
casbin?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
I am trying to use spicedb for authZ
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Introspection calls are cached now? From the official sdk?
No clue, I am using my custom introspect token thingy with the pkce thingy so not using it
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
neat!
That's server side though, be nice to have a TTL cache on client side for the SDKs for heavy calls that can suffer a 60s or similar expiry window
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
I shared my code snippet, looking at that repo, it is doing osme fancy stuff with the key endpoint, maybe share your findings in the issue thread
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View