Closed marcellmars closed 4 hours ago
By the way, no need to rebase or force push after reviewing starts (it makes the review more difficult). https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#maintaining-open-prs
Just push new commits, and the final merge will squash.
By the way, no need to rebase or force push after reviewing starts (it makes the review more difficult). https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#maintaining-open-prs
Just push new commits, and the final merge will squash.
thank you for your patience. this is my first pull request and i still learn it.
Could we have a screenshot of the new grant page?
Please send a update doc PR to https://gitea.com/gitea/docs
Could we have a screenshot of the new grant page?
Could we have a screenshot of the new grant page?
Igh>
Thank you. The permissions should be highlighted,maybe a bold font?
Please send a update doc PR to https://gitea.com/gitea/docs
Thank you. The permissions should be highlighted,maybe a bold font?
committed.
Please don't add HTML tags in translations. You can
{{ctx.Locale.Tr "auth.authorize_application_with_scopes" (HTMLFormat "<b>%s</b>" .Scope)}}
We have plan to remove all HTML tags from the previous translations.
{{ctx.Locale.Tr "auth.authorize_application_with_scopes" (HTMLFormat "<b>%s</b>" .Scope)}}
We have plan to remove all HTML tags from the previous translations.
great. i opened translations and few lines below there was some html. so i just copied the pattern ;)
Resolve #31609
This PR was initiated following my personal research to find the lightest possible Single Sign-On solution for self-hosted setups. The existing solutions often seemed too enterprise-oriented, involving many moving parts and services, demanding significant resources while promising planetary-scale capabilities. Others were adequate in supporting basic OAuth2 flows but lacked proper user management features, such as a change password UI.
Gitea hits the sweet spot for me, provided it supports more granular access permissions for resources under users who accept the OAuth2 application.
This PR aims to introduce granularity in handling user resources as nonintrusively and simply as possible. It allows third parties to inform users about their intent to not ask for the full access and instead request a specific, reduced scope. If the provided scopes are only the typical ones for OIDC/OAuth2—
openid
,profile
,email
, andgroups
—everything remains unchanged (currently full access to user's resources). Additionally, this PR supports processing scopes already introduced with personal tokens (e.g.read:user
,write:issue
,read:group
,write:repository
...)Personal tokens define scopes around specific resources: user info, repositories, issues, packages, organizations, notifications, miscellaneous, admin, and activitypub, with access delineated by read and/or write permissions.
The initial case I wanted to address was to have Gitea act as an OAuth2 Identity Provider. To achieve that, with this PR, I would only add
openid public-only
to provide access token to the third party to authenticate the Gitea's user but no further access to the API and users resources.Another example: if a third party wanted to interact solely with Issues, it would need to add
read:user
(for authorization) andread:issue
/write:issue
to manage Issues.My approach is based on my understanding of how scopes can be utilized, supported by examples like Sample Use Cases: Scopes and Claims on auth0.com.
I renamed
CheckOAuthAccessToken
toGetOAuthAccessTokenScopeAndUserID
so now it returns AccessTokenScope and user's ID. In the case of additional scopes inuserIDFromToken
the defaultall
would be reduced to whatever was asked via those scopes. The main difference is the opportunity to reduce the permissions fromall
, as is currently the case, to what is provided by the additional scopes described above.Screenshots: