Using OAuth2.0 for authentication
Please be aware that environment variable values are case-sensitive.
Environment Variable Name | Meaning | Default Value | Others |
---|---|---|---|
OAUTH2_ENABLE | Whether to enable OAuth2.0 login service | Set to true to enable, or leave blank or unset to disable | |
OAUTH2_AUTH_URL | OAuth2.0 application login authorization link | Required when enabling OAuth2.0 service | |
OAUTH2_ACCESS_TOKEN_URL | OAuth2.0 application link to exchange AccessToken | Required when enabling OAuth2.0 service | |
OAUTH2_USER_INFO_URL | URL to exchange personal information based on access token | Required when enabling OAuth2.0 service | |
OAUTH2_CLIENT_ID | OAuth2.0 application ID | Required when enabling OAuth2.0 service | |
OAUTH2_CLIENT_SECRET | OAuth2.0 application access Secret | Required when enabling OAuth2.0 service | |
OAUTH2_SCOPE | Scope | email,profile,openid | Configuration is typically required as described in the provider's documentation. The default value is compatible with Azure AD and Okta. |
OAUTH2_USER_ID_ATTR | Default is 'id', used as the unique id for OAuth2.0 user attributes | id | Optional |
OAUTH2_USER_EMAIL_ATTR | Email field | Optional | |
OAUTH2_USER_NAME_ATTR | Name field | name | Optional |
OAUTH2_USER_AVATAR_ATTR | Avatar field | avatar | Optional |
OAUTH2_LOGIN_TITLE | Control the button text which was showed on client Login page | Continue with OAuth 2.0 | Optional |
Configuration Example
-e OAUTH2_ENABLE=true
-e OAUTH2_AUTH_URL=https://xxx.example.com/oauth/auth
-e OAUTH2_ACCESS_TOKEN_URL=https://xxx.example.com/oauth/token
-e OAUTH2_CLIENT_ID=6539......c89ae
-e OAUTH2_CLIENT_SECRET=ca67b272......ab449d8b45
-e OAUTH2_USER_INFO_URL=https://core.example.com/oauth/me
Modified at 2024-12-04 08:06:43