OpenID 500 Error from AliCloud OAuth Integration #4680

Closed
opened 2025-11-02 05:59:16 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @caryyu on GitHub (Jan 19, 2020).

Description

You can just register an ali-cloud account and use its RAM oauth2 feature, then you will find out the integration won't work

I assume the issue is because Alicloud userdetail doesn't fit the standard user claims return

Screenshots

image

Originally created by @caryyu on GitHub (Jan 19, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): eb0ee6b - Git version: Forgot - Operating system: Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (https://help.aliyun.com/document_detail/69964.html - Chinese only) - [ ] No - [ ] Not relevant - Log gist: No Need ## Description You can just register an ali-cloud account and use its RAM oauth2 feature, then you will find out the integration won't work > I assume the issue is because Alicloud userdetail doesn't fit the standard user claims return ## Screenshots ![image](https://user-images.githubusercontent.com/4496641/72673533-cc03ba80-3aa6-11ea-9877-4de9b6855caa.png) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 05:59:16 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jan 19, 2020):

Do you use https://oauth.aliyun.com/.well-known/openid-configuration as your OpenID connect URL? Any logs you can provide that show what the trace of error is?

@techknowlogick commented on GitHub (Jan 19, 2020): Do you use https://oauth.aliyun.com/.well-known/openid-configuration as your OpenID connect URL? Any logs you can provide that show what the trace of error is?
Author
Owner

@caryyu commented on GitHub (Jan 19, 2020):

@techknowlogick Yeah, I did use https://oauth.aliyun.com/.well-known/openid-configuration in the auto-discovery field, in fact, at first when I click the log-in button, it definitely will redirect to Alicloud login page, however, after all the login-actions being done on the alicloud side, which will redirect back without any problems, and then in Gitea, this error came out, which I suspect the error is something relevant to OAuth2 userdetail-claims

@caryyu commented on GitHub (Jan 19, 2020): @techknowlogick Yeah, I did use https://oauth.aliyun.com/.well-known/openid-configuration in the auto-discovery field, in fact, at first when I click the log-in button, it definitely will redirect to Alicloud login page, however, after all the login-actions being done on the alicloud side, which will redirect back without any problems, and then in Gitea, this error came out, which I suspect the error is something relevant to OAuth2 userdetail-claims
Author
Owner

@caryyu commented on GitHub (Jan 19, 2020):

@techknowlogick sorry, I don't know the log file where the trace error is, I will try that later today

@caryyu commented on GitHub (Jan 19, 2020): @techknowlogick sorry, I don't know the log file where the trace error is, I will try that later today
Author
Owner

@caryyu commented on GitHub (Jan 20, 2020):

@techknowlogick From today's test, I face another issue which I don't know if it is normal behavior after logging-in via OpenID, very weird....:
image

@caryyu commented on GitHub (Jan 20, 2020): @techknowlogick From today's test, I face another issue which I don't know if it is normal behavior after logging-in via OpenID, very weird....: ![image](https://user-images.githubusercontent.com/4496641/72704026-63920780-3b92-11ea-9812-9e8bb2975f4a.png)
Author
Owner

@techknowlogick commented on GitHub (Jan 21, 2020):

Ah ok. It's now working as expected. You need to link your alicloud account to a gitea account.

Looking at your screenshot you are using a really old version of gitea (1.6.4), and I recommend you upgrade to the latest 1.10.3.

I will close this as oidc is working as expected with alicloud.

@techknowlogick commented on GitHub (Jan 21, 2020): Ah ok. It's now working as expected. You need to link your alicloud account to a gitea account. Looking at your screenshot you are using a really old version of gitea (1.6.4), and I recommend you upgrade to the latest 1.10.3. I will close this as oidc is working as expected with alicloud.
Author
Owner

@caryyu commented on GitHub (Jan 21, 2020):

@techknowlogick Any way that I can prevent second registration if SSO has been enabled like this case, cuz the latest version I tried with alicloud will still ask me for a username and email sign-up, Ideally, we can preset both email and username from OAuth2 user details to avoid this second action to implement more reasonable SSO

@caryyu commented on GitHub (Jan 21, 2020): @techknowlogick Any way that I can prevent second registration if SSO has been enabled like this case, cuz the latest version I tried with alicloud will still ask me for a username and email sign-up, Ideally, we can preset both email and username from OAuth2 user details to avoid this second action to implement more reasonable SSO
Author
Owner

@techknowlogick commented on GitHub (Jan 21, 2020):

@caryyu the functionality you are looking at exists in a more recent version and so I recommend upgrading.

@techknowlogick commented on GitHub (Jan 21, 2020): @caryyu the functionality you are looking at exists in a more recent version and so I recommend upgrading.
Author
Owner

@caryyu commented on GitHub (Jan 22, 2020):

@techknowlogick would you mind sharing a little reference about here, which can simply be a commit link or anything else equivalent, thanks a lot.

@caryyu commented on GitHub (Jan 22, 2020): @techknowlogick would you mind sharing a little reference about here, which can simply be a commit link or anything else equivalent, thanks a lot.
Author
Owner

@techknowlogick commented on GitHub (Jan 22, 2020):

I believe the following ticket #5006 enhances the flow. However version 1.6.4 that you are on has security issues, and so you should update to latest stable (1.10.3) regardless.

For more questions please join us in chat https://discord.gg/gitea or on our forum https://discourse.gitea.io/ and we'd be happy to help there.

@techknowlogick commented on GitHub (Jan 22, 2020): I believe the following ticket [#5006](https://togithub.com/go-gitea/gitea/pull/5006) enhances the flow. However version 1.6.4 that you are on has security issues, and so you should update to latest stable (1.10.3) regardless. For more questions please join us in chat https://discord.gg/gitea or on our forum https://discourse.gitea.io/ and we'd be happy to help there.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4680