-
Notifications
You must be signed in to change notification settings - Fork 137
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
Questions about the example #144
Comments
Hi @TwiN Thanks for these great questions. I'll do my best to answer them and sorry for the late response. First of all, it certainly needs some more documentation and explanations about the structure and the examples, especially the server one. I like the idea of a small diagram to help people understand. I'll try to give you short overview here and will update the documentation and examples as soon as possible (#116). Especially the server example needs some extra dedication. In the meantime I can already refer you to our implementation: https://github.com/caos/zitadel/tree/main/internal/api/oidc The structure or most important packages are basically these:
So:
So your suggestion for I hope I could clarify this a bit and give you a basic idea. It definitely showed me that we need to improve the docs and examples. |
@livio-a Thank you so much for taking the time to answer me. You and your fellow contributors have definitely done some amazing work. I went into this with very little knowledge on the provider side of things, but after going through https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowSteps and https://www.rfc-editor.org/rfc/rfc6749.txt, I have to admit that bootstrapping an OP with so little configuration needed from the end user is quite a feat! I may come around and contribute at some point since I'll have to implement an IODC provider eventually, alas, my hands are full with other projects short term. In any case, thanks again! |
Hey there,
My knowledge when it comes to hosting an OIDC provider is fairly limited, and I have a couple of questions I hope you'll be able to answer.
For the sake of verbosity, I plan on integrating the server implementation of this library in an existing application. It will therefore live alongside multiple other handlers. Furthermore, I'm only interested in the app client implementation, though I'm not 100% sure what flow each of the folder represent.
Why is there a
/healthz
handler registered by the server example? Is it because the server is meant to be run as a standalone application (albeit with some modifications to support endpoints like userinfo, etc.)What exactly does the
t
variable represent here?:https://github.com/caos/oidc/blob/eb10752e485ced36bd996bcb290c6e617f5ea449/example/internal/mock/storage.go#L118-L122
Why is this function called
HandleCallback
? Shouldn't the callback technically be on the client side? From what I understand, it would be more appropriate to name it something likeHandleLoginAttempt
?https://github.com/caos/oidc/blob/eb10752e485ced36bd996bcb290c6e617f5ea449/example/server/default/default.go#L68
If the statement above is accurate, then I think the handler should also be in charge of verifying the credentials (username/password) of the user. If so, how does one convey that the verification of the credentials was successful and convey that data? From what I see, it's just redirecting to another path
https://github.com/caos/oidc/blob/eb10752e485ced36bd996bcb290c6e617f5ea449/example/server/default/default.go#L71
Still in the same function/handler above, assuming we swap the input
client
forusername
and add an extra inputpassword
in theHandleLogin
handler, we would get something like:instead of
https://github.com/caos/oidc/blob/eb10752e485ced36bd996bcb290c6e617f5ea449/example/server/default/default.go#L68-L71
which prompts the question, is the
id
passed as query parameter in the redirect function expected to be some kind of session id?I think a diagram -- not just of a typical IODC provider, but of the exact endpoints used in each client example -- would greatly help people in understanding how it works. Normally, I'd offer to do it, alas, like I said, I'm not really knowledgeable when it comes to the implementation of an IODC provider 😅 If I end up getting the gist of it, I'll definitely try to help out with the documentation though.
The text was updated successfully, but these errors were encountered: