Skip to content
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

Oidc #1

Closed
gedw99 opened this issue Aug 19, 2023 · 2 comments
Closed

Oidc #1

gedw99 opened this issue Aug 19, 2023 · 2 comments

Comments

@gedw99
Copy link

gedw99 commented Aug 19, 2023

zitadel/zitadel-go#236

I suggested your repo as a basis / example.

Maybe you also interested in a generic oidc / oath system based on htmx.

Zitadel also supports passkeys and other fancy stuff

@Darkness4
Copy link
Owner

Darkness4 commented Oct 3, 2023

I'm familiar with OIDC, especially since I use one (Keycloak) in my company, but I'm a bit rusty. It seems that zitadel is something similar.

As I understand it, OIDC is an identity provider with OAuth2 capability. I can use the OAuth2 flow easily by parsing the discovery document (google example), and instead of calling the Github API to verify and retrieve user information, I can use the ID token, validate it by verifying a signature and certificates and retrieve user information using the OIDC-compliant scope.

While it seems interesting to extend the experiment to OIDC, it's a shame that Github doesn't support OIDC. I may extend the example with Google Auth, through.

Theorically, it looks like I must:

  1. Change the scope of the login function and add openid profile email.
  2. Remove any hard-coded value about authorizationURL, userURL etc... and use the discovery document.
  3. Parse and verify the ID token in my getCurrentUser instead of calling the Github API.

To be fair, I should use the go-oidc package instead. And I should have used the package oauth2. Right now, the implementation is very "naive".

@Darkness4
Copy link
Owner

Support added with go-oidc and oauth2: 829a866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants