-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Adding group claim name for admin and required does not show in gui #18388
Comments
When set in the GUI, Additional scopes and Group claim name for administrators show up in the database. Required shows up when entered on CLI, not in GUI Before update: {"Provider":"openidConnect","ClientID":"Gitea","ClientSecret":"1057f9ac-3acd-456a-8c06-61180ad9d8a0","OpenIDConnectAutoDiscoveryURL":"http://keycloak.tooling.test:8080/auth/realms/netcicd/.well-known/openid-configuration","CustomURLMapping":{},"IconURL":"","Scopes":[],"RequiredClaimName":"gitea-admin","RequiredClaimValue":"","GroupClaimName":"gitea-group","AdminGroup":"gitea-admin","RestrictedGroup":""} After update: {"Provider":"openidConnect","ClientID":"Gitea","ClientSecret":"1057f9ac-3acd-456a-8c06-61180ad9d8a0","OpenIDConnectAutoDiscoveryURL":"http://keycloak.tooling.test:8080/auth/realms/netcicd/.well-known/openid-configuration","CustomURLMapping":{},"IconURL":"","Scopes":[""],"RequiredClaimName":"","RequiredClaimValue":"gitea-admin","GroupClaimName":"","AdminGroup":"","RestrictedGroup":""} restoring the data makes no difference... When updated through CLI with gitea admin auth update-oauth --id 1 --required-claim-name gitea-admin --admin-group gitea-admin, it works when I provide the gitea-admin claim but the user is not admin. When the group-claim-name is updated through the CLI and a corresponding claim is made in Keycloak: This is the associated jwt And for an ordinary user: and as shown, the ordinary user is in the group gitea-netcicd-read, this group has read access: It would be much more convenient if the implementation would just read the default resource_access claim for the Client_ID where the roles are the group names... |
The rendering in your screenshots appears to be a little odd. Do you have old custom templates? |
Hi Zeripath, |
It appears that there was a broken merge of the edit.tmpl page during the merge of go-gitea#16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix go-gitea#18388 Signed-off-by: Andrew Thornton <[email protected]>
OK the edit page template looks to have suffered a conflict merge at some point and it got broke. diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index a9942354c..efa440ff3 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -286,6 +286,10 @@
<input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
<p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
</div>
+ </div>
+ <div class="oauth2_use_custom_url inline field">
+ <div class="ui checkbox">
+ <label><strong>{{.i18n.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
<input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $cfg.CustomURLMapping}}checked{{end}}>
</div>
</div>
would fix the template. |
It appears that there was a broken merge of the edit.tmpl page during the merge of #16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix #18388 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#18412 It appears that there was a broken merge of the edit.tmpl page during the merge of go-gitea#16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix go-gitea#18388 Signed-off-by: Andrew Thornton <[email protected]>
Backport #18412 It appears that there was a broken merge of the edit.tmpl page during the merge of #16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix #18388 Signed-off-by: Andrew Thornton <[email protected]>
It appears that there was a broken merge of the edit.tmpl page during the merge of go-gitea#16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix go-gitea#18388 Signed-off-by: Andrew Thornton <[email protected]>
Gitea Version
1.16.0-rc1
Git Version
No response
Operating System
docker: gitea/gitea:1.16.0-rc1
How are you running Gitea?
docker container as part of https://github.com/Devoteam/CICD-toolbox
Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
when running
gitea admin auth update-oauth --id 1 --required-claim-name gitea-admin --admin-group gitea-admin
in the container, this does not show in the gui. Adding these fields in the gui gives 200 in the log, but no entry in the gui
Screenshots
secret in picture is randomly generated
The text was updated successfully, but these errors were encountered: