GithubHelp home page GithubHelp logo

Integrate an OAuth2 provider about gitea HOT 44 CLOSED

go-gitea avatar go-gitea commented on May 1, 2024 51
Integrate an OAuth2 provider

from gitea.

Comments (44)

aaronpk avatar aaronpk commented on May 1, 2024 6

It would be fantastic if Gitea were its own OAuth2 provider! In fact, IndieAuth is the perfect candidate for how to implement this.

IndieAuth is an OAuth 2.0 extension, which avoids the centralized problems with existing OAuth solutions by using DNS for "registration" of client IDs and user IDs. Every user account is identified by a URL (for Gitea this could be your Gitea user page), and client IDs are also URLs (would be the Gitea instance home page in this case.)

This would let people sign in to other Gitea instances without any sort of prior relationship or doing client registration and such. Happy to walk through this in more detail if you're interested!

(originally posted at https://aaronparecki.com/2018/06/04/12/gitea-indieauth)

from gitea.

ekozan avatar ekozan commented on May 1, 2024 5

I'll make an PRs for this one if nobody work on it

  • 1 : Add OIDC lib and API
  • 2 : Add Application managment
  • 3 : Add Oauth HTTP HANDLER

from gitea.

techknowlogick avatar techknowlogick commented on May 1, 2024 5

If anyone is interested in working on this, I wrote an adapter for https://github.com/go-oauth2/oauth2 that allows use of XORM https://github.com/techknowlogick/go-oauth2-xorm Next would be to add the routes to handle oauth.

from gitea.

xdevs23 avatar xdevs23 commented on May 1, 2024 5

Looking forward to this

from gitea.

lafriks avatar lafriks commented on May 1, 2024 3

I think this one could be good option to integrate into gitea - https://github.com/coreos/dex

from gitea.

ekozan avatar ekozan commented on May 1, 2024 3

@tarelda Oauth2 is realy simple protocol integrate an external library is just pointless, and many required library is already present in Gitea - 60% of the oauth or OIDC provider is the UI :)

I'll make the PR next week i had no time for finish the UI this week

from gitea.

tboerger avatar tboerger commented on May 1, 2024 2

I think we can always integrate it but add an option for admins to disable it

from gitea.

joubertredrat avatar joubertredrat commented on May 1, 2024 1

Oh, sounds good this :)

from gitea.

joubertredrat avatar joubertredrat commented on May 1, 2024 1

Nice idea 👍

from gitea.

femaref avatar femaref commented on May 1, 2024 1

is there an ETA for this? Would make life easier.

from gitea.

jonasfranz avatar jonasfranz commented on May 1, 2024 1

https://github.com/ory/fosite looks like a promising library to integrate this feature. It is used by hydra AFAIK.

from gitea.

tboerger avatar tboerger commented on May 1, 2024 1

IMHO https://github.com/coreos/dex looks more promising

from gitea.

bkcsoft avatar bkcsoft commented on May 1, 2024 1

@ekozan Mind linking to "OIDC" since I have no clue what that is 🙂

from gitea.

bkcsoft avatar bkcsoft commented on May 1, 2024

Should this be integrated as "The" login-handler, or as an optional dependency? (i.e. build tag)

from gitea.

lunny avatar lunny commented on May 1, 2024

No build tag but default is closed until admin open it.

from gitea.

bkcsoft avatar bkcsoft commented on May 1, 2024

@tboerger @lunny I was more wondering if all Authentication should be handled by OAuth, therefore removing the old auth-module

from gitea.

JohnTheodore avatar JohnTheodore commented on May 1, 2024

+1, this would be awesome!!!

from gitea.

lunny avatar lunny commented on May 1, 2024

@lafriks Looks good, but it requires go1.8 I think.

from gitea.

mikehaertl avatar mikehaertl commented on May 1, 2024

Here's another Go based alternative: https://github.com/ory/hydra

ORY Hydra is not an identity provider (user sign up, user log in, password reset flow), but connects to your existing identity provider through a consent app.

It seems quite easy to set up. Here's a nice tutorial: https://www.ory.am/run-oauth2-server-open-source-api-security.html?

from gitea.

lafriks avatar lafriks commented on May 1, 2024

@mikehaertl Hydra does not support JWT and from what I understand even if added they won't be in community edition - https://ory.gitbooks.io/hydra/content/faq.html#is-jwt-supported

from gitea.

tboerger avatar tboerger commented on May 1, 2024

JWT is a must have for drone integration

from gitea.

ts468 avatar ts468 commented on May 1, 2024

Remotely related, but would it also be possible to extend gitea so that gitea can listen on a second interface over which every access is granted automatically?

The idea is to allow tooling without OAuth2 authentication capabilities, like Hydra, to fetch data over, e.g., the loopback interface.

from gitea.

bkcsoft avatar bkcsoft commented on May 1, 2024

Migrating all existing users would be a PITA though 😂

from gitea.

tboerger avatar tboerger commented on May 1, 2024

Sounds like it's comparable with openid connect.

from gitea.

aaronpk avatar aaronpk commented on May 1, 2024

Not quite, since OpenID Connect still requires registering clients to get client credentials to use with the flows. There is a dynamic client registration part of OpenID Connect, but this allows you to entirely bypass the need for registering clients separately since we just piggyback on the existing DNS for identifying clients.

(originally posted at https://aaronparecki.com/2018/06/04/18/)

from gitea.

ekozan avatar ekozan commented on May 1, 2024

@bkcsoft :D sorry openid Connect : http://openid.net/connect/

It's like openid3 based on oauth2

but i have dig more and i'll stick to Oauth2 for the moment

Because all big ( Gitlab, Github, etc... ) use Oauth

from gitea.

ekozan avatar ekozan commented on May 1, 2024

I need some help and advise on the design :)

Do you think i'm right :

  • Every User can create an oauth app
  • Every Org can create an oauth app
  • Gitea admin can create offical app

@tboerger @bkcsoft @lunny

from gitea.

tarelda avatar tarelda commented on May 1, 2024

IMHO, integrate OAuth2 endpoints with maintained external lib (no point in reinventing the wheel) into API. Maybe even strip out code generation from authentication code flow and force only global/org scope. At least this would work for tools like Drone, registry etc.

from gitea.

lunny avatar lunny commented on May 1, 2024

@ekozan just like github, I think. :)

from gitea.

jonasfranz avatar jonasfranz commented on May 1, 2024

@ekozan You can create a seperate PR for the UI, this may improve the review speed.

from gitea.

vtolstov avatar vtolstov commented on May 1, 2024

so, what library decided to use? i don't find any pr about oauth2 server in gitea

from gitea.

xdevs23 avatar xdevs23 commented on May 1, 2024

I'm waiting for this one as well. Definitely looking forward to it!

from gitea.

JohnTheodore avatar JohnTheodore commented on May 1, 2024

Is there a branch or PR related to this change? or we're still in the discussion phase.

from gitea.

lunny avatar lunny commented on May 1, 2024

@JohnTheodore no people are working on this.

from gitea.

xdevs23 avatar xdevs23 commented on May 1, 2024

That's unfortunate

from gitea.

JohnTheodore avatar JohnTheodore commented on May 1, 2024

@ekozan mentioned a PR, I wasn't sure if that happened.

from gitea.

JohnTheodore avatar JohnTheodore commented on May 1, 2024

@lunny it sounds like dex would be the library to use for resolving this issue? Are there changes to dex that are necessary for it to be the way you want?

In general how does the go-gitea project deal with something like a 'design document'. So if you, tboerger, lafriks, bkcsoft, etc all agree on a design with say dex, is that design written down somewhere? This way if someone wants to work on it, they'll do it in a way the project maintainers want.

from gitea.

lunny avatar lunny commented on May 1, 2024

We ever want to create a design process but in fact we haven't obey that because it's unnecessary for most features. We depend on Pull Requests approvals to control the quality of the codes. Any PR some maintainers against will be discussed more until two maintainers agreed and no maintainers against. A big PR of course should be required write the design detail on the PR's description. As an oauth provider, it's a mature technology.I think what we need to do is to find a maintained-well library and follow it's design.

from gitea.

ekozan avatar ekozan commented on May 1, 2024

i'm totaly busy .... :/ i havent finish the work

from gitea.

lunny avatar lunny commented on May 1, 2024

@ekozan never mind. :)

from gitea.

stale avatar stale commented on May 1, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

from gitea.

AfroThundr3007730 avatar AfroThundr3007730 commented on May 1, 2024

There should be a way to mark this as "keep open", since there is clearly still demand for this.

from gitea.

jonasfranz avatar jonasfranz commented on May 1, 2024

There is a open PR too.

from gitea.

AfroThundr3007730 avatar AfroThundr3007730 commented on May 1, 2024

@lafriks Mind tagging this one as reviewed too? :)

from gitea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.