How to use enterprise WeChat authentication source to scan code and log in to different accounts #14592

Open
opened 2025-11-02 11:17:02 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Skyrainy-M on GitHub (Jun 12, 2025).

Description

I have configured the authentication source for WeChat Work's scan-to-login using OAuth2, and I have bound the system administrator as the account for scan-to-login. However, other members under the same WeChat Work organization as this administrator are all logging in with this administrator's account after scanning. I don't know how to adjust other parameters of the authentication source to allow others to log in with their respective accounts.

Gitea Version

1.23.8

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Profile URL
https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=%s&code=%s
附加授权范围(Scopes)
snsapi_userinfo
必须填写 Claim 声明的名称
UserId
设置此名称,只有具有此名称的声明(Claim)的用户可从此源登录
必须填写 Claim 声明的值
设置此值,只有拥有对应的声明(Claim)的名称和值的用户才被允许从此源登录
用于提供用户组名称的 Claim 声明名称。(可选)
department
管理员用户组的 Claim 声明值。(可选 - 需要上面的声明名称)
受限用户组的 Claim 声明值。(可选 - 需要上面的声明名称)

Git Version

2.43.5

Operating System

Ubuntu

How are you running Gitea?

I deployed Gitea using Docker

Database

MySQL/MariaDB

Originally created by @Skyrainy-M on GitHub (Jun 12, 2025). ### Description I have configured the authentication source for WeChat Work's scan-to-login using OAuth2, and I have bound the system administrator as the account for scan-to-login. However, other members under the same WeChat Work organization as this administrator are all logging in with this administrator's account after scanning. I don't know how to adjust other parameters of the authentication source to allow others to log in with their respective accounts. ### Gitea Version 1.23.8 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots Profile URL https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=%s&code=%s 附加授权范围(Scopes) snsapi_userinfo 必须填写 Claim 声明的名称 UserId 设置此名称,只有具有此名称的声明(Claim)的用户可从此源登录 必须填写 Claim 声明的值 设置此值,只有拥有对应的声明(Claim)的名称和值的用户才被允许从此源登录 用于提供用户组名称的 Claim 声明名称。(可选) department 管理员用户组的 Claim 声明值。(可选 - 需要上面的声明名称) 受限用户组的 Claim 声明值。(可选 - 需要上面的声明名称) ### Git Version 2.43.5 ### Operating System Ubuntu ### How are you running Gitea? I deployed Gitea using Docker ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 11:17:02 -06:00
Author
Owner

@Skyrainy-M commented on GitHub (Jun 12, 2025):

Here is the Chinese version of my issue. I hope there are people in your team who understand Chinese and can help me take a look. Thank you all in advance!
我配置了OAuth2的企业微信认证源,配置如下图,然后我使用组织管理者扫码登录并绑定的对应的账号,然后此账号能正常扫码登录;但是这个企业下的其他成员,使用企业微信扫码的时候,登录后显示的都是这个组织管理者的账号,我怎么调整参数才能让其他人各自扫码然后登录各自的账号?

Image

@Skyrainy-M commented on GitHub (Jun 12, 2025): Here is the Chinese version of my issue. I hope there are people in your team who understand Chinese and can help me take a look. Thank you all in advance! 我配置了OAuth2的企业微信认证源,配置如下图,然后我使用组织管理者扫码登录并绑定的对应的账号,然后此账号能正常扫码登录;但是这个企业下的其他成员,使用企业微信扫码的时候,登录后显示的都是这个组织管理者的账号,我怎么调整参数才能让其他人各自扫码然后登录各自的账号? ![Image](https://github.com/user-attachments/assets/8a469f81-2fed-48e0-a3cc-dd94e897a3bc)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14592