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

[feature request] different oidc/oauth providers #10164

Open
andrewzah opened this issue Feb 6, 2020 · 8 comments
Open

[feature request] different oidc/oauth providers #10164

andrewzah opened this issue Feb 6, 2020 · 8 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@andrewzah
Copy link

andrewzah commented Feb 6, 2020

How feasible would it be to implement different oidc/oauth providers? Ones with a different flow than github et. al, such as login.gov. I already implemented a middleware handler for login.gov for caddy in golang, so adapting it shouldn't be too difficult.

I can work on a PR if someone can give me some pointers on where to start looking, etc.

@techknowlogick techknowlogick added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Feb 6, 2020
@techknowlogick
Copy link
Member

This is already possible. Under auth tab in admin panel, add a new auth source with type oauth2, and select OIDC as type. Then use https://idp.int.identitysandbox.gov/.well-known/openid-configuration as the auto discovery URL (and the other information as provided by login.gov)

@andrewzah
Copy link
Author

andrewzah commented Feb 7, 2020

@techknowlogick the auto discovery doesn't work with login.gov.

  • No client_secret is needed, just an issuer_id (aka client_id).
  • login.gov needs other fields like acr_values and nonce.

Basically its a different flow. ¯\(ツ)/¯. I see there are other providers, so would it be hard for me to add a custom provider if it has a different flow?

@techknowlogick
Copy link
Member

techknowlogick commented Feb 12, 2020

Ah, in that case, let me re-open this issue.

We use https://github.com/markbates/goth for most login systems, and so if you could get login.gov into that upstream library it isn't much additional work to get it into gitea. I could provide guidance if needed, feel free to ask any question :)

@techknowlogick techknowlogick added type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/question Issue needs no code to be fixed, only a description on how to fix it yourself. labels Feb 12, 2020
@andrewzah
Copy link
Author

@techknowlogick thanks, I ended up making a PR for goth earlier today. Now I’m just waiting on feedback. markbates/goth#318

@droplet-js
Copy link

I have the same problem.
I want to use gitea as auth provider for traefik,but traefik-forward-auth doesn't support oauth2

@golyalpha
Copy link

golyalpha commented Jun 7, 2023

I'm having a similar issue, though I have a custom OIDC provider implemented with Authlib - it currently requires the "nonce" parameter be provided. (And it seems to be good practice to do that.)

@andrewzah
Copy link
Author

Just realized it's been 3 years. Nice. We just forked goth (see my PR above) and built gitea locally using that fork. Hope that helps.

@golyalpha
Copy link

golyalpha commented Jun 8, 2023

@andrewzah thanks for that. Thankfully, since I can just change the code for the OIDC provider I intended to use, I just disabled the nonce requirement until something happens with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

4 participants