mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
💄 style: Added AUTH_MICROSOFT_ENTRA_ID_BASE_URL routing (#9293)
Added AUTH_MICROSOFT_ENTRA_ID_BASE_URL routing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node",
|
||||
"features": {
|
||||
"ghcr.io/devcontainer-community/devcontainer-features/bun.sh:1": {}
|
||||
}
|
||||
"ghcr.io/devcontainer-community/devcontainer-features/bun.sh:1": {},
|
||||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
|
||||
},
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node"
|
||||
}
|
||||
|
||||
@@ -205,6 +205,13 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
||||
|
||||
### Microsoft Entra ID
|
||||
|
||||
#### `AUTH_MICROSOFT_ENTRA_ID_BASE_URL`
|
||||
|
||||
- Type: Required
|
||||
- Description: - Description: Base URL for Azure login. Use when authenticating against other Microsoft sovereignty clouds like Azure US Government.
|
||||
- Default: `https://login.microsoftonline.com`
|
||||
- Example: `https://login.microsoftonline.us`
|
||||
|
||||
#### `AUTH_AZURE_AD_ID`
|
||||
|
||||
- Type: Required
|
||||
|
||||
@@ -8,6 +8,10 @@ function getTenantId() {
|
||||
);
|
||||
}
|
||||
|
||||
function getClientLoginBaseUrl() {
|
||||
return process.env.AUTH_MICROSOFT_ENTRA_ID_BASE_URL ?? 'https://login.microsoftonline.com';
|
||||
}
|
||||
|
||||
function getIssuer() {
|
||||
const issuer = process.env.MICROSOFT_ENTRA_ID_ISSUER;
|
||||
if (issuer) {
|
||||
@@ -16,7 +20,7 @@ function getIssuer() {
|
||||
const tenantId = getTenantId();
|
||||
if (tenantId) {
|
||||
// refs: https://github.com/nextauthjs/next-auth/discussions/9154#discussioncomment-10583104
|
||||
return `https://login.microsoftonline.com/${tenantId}/v2.0`;
|
||||
return `${getClientLoginBaseUrl()}/${tenantId}/v2.0`;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user