зеркало из
1
0
Форкнуть 0
This commit is contained in:
Timothy Wang 2024-08-07 14:29:40 -04:00
Родитель d32027fc55
Коммит 5feccd64b8
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -63,8 +63,8 @@ export const CUSTOM_AUTH_TOKEN_ENDPOINT_MAPPING: AuthIdentityTokenEndpoints = {
path: "/login/oauth/access_token",
},
aad: {
host: "login.microsoft.com",
path: "/tenantId/oauth/v2.0/token",
host: "login.microsoftonline.com",
path: "/tenantId/oauth2/v2.0/token",
},
};
export const CUSTOM_AUTH_USER_ENDPOINT_MAPPING: AuthIdentityTokenEndpoints = {

Просмотреть файл

@ -150,8 +150,8 @@ const getOAuthToken = function (authProvider: string, codeValue: string, clientI
code: codeValue,
client_id: clientId,
client_secret: clientSecret,
...(authProvider !== "github" && { grant_type: authProvider }),
...(authProvider !== "github" && { redirect_uri: `${redirectUri}/.auth/login/${authProvider}/callback` }),
grant_type: "authorization_code",
redirect_uri: `${redirectUri}/.auth/login/${authProvider}/callback`,
});
let tokenPath = CUSTOM_AUTH_TOKEN_ENDPOINT_MAPPING?.[authProvider]?.path;

Просмотреть файл

@ -90,7 +90,7 @@ const httpTrigger = async function (context: Context, request: IncomingMessage,
location = `https://github.com/login/oauth/authorize?response_type=code&client_id=${clientId}&redirect_uri=${redirectUri}/.auth/login/github/callback&scope=read:user&state=${hashedState}`;
break;
case "aad":
location = `${aadIssuer}/authorize?response_type=code&client_id=${clientId}&redirect_uri=${redirectUri}/.auth/login/aad/callback&scope=openid&state=${hashedState}`;
location = `${aadIssuer}/authorize?response_type=code&client_id=${clientId}&redirect_uri=${redirectUri}/.auth/login/aad/callback&scope=openid+profile+email&state=${hashedState}`;
break;
default:
break;