mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #3823 from akhilmhdh/feat/aws-auth-increase-limit
feat: resolved okta oidc failing
This commit is contained in:
@@ -698,9 +698,9 @@ export const oidcConfigServiceFactory = ({
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
(_req: any, tokenSet: TokenSet, cb: any) => {
|
(_req: any, tokenSet: TokenSet, cb: any) => {
|
||||||
const claims = tokenSet.claims();
|
const claims = tokenSet.claims();
|
||||||
if (!claims.email || !claims.given_name) {
|
if (!claims.email) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Invalid request. Missing email or first name"
|
message: "Invalid request. Missing email claim."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,12 +713,19 @@ export const oidcConfigServiceFactory = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const name = claims?.given_name || claims?.name;
|
||||||
|
if (!name) {
|
||||||
|
throw new BadRequestError({
|
||||||
|
message: "Invalid request. Missing name claim."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const groups = typeof claims.groups === "string" ? [claims.groups] : (claims.groups as string[] | undefined);
|
const groups = typeof claims.groups === "string" ? [claims.groups] : (claims.groups as string[] | undefined);
|
||||||
|
|
||||||
oidcLogin({
|
oidcLogin({
|
||||||
email: claims.email.toLowerCase(),
|
email: claims.email.toLowerCase(),
|
||||||
externalId: claims.sub,
|
externalId: claims.sub,
|
||||||
firstName: claims.given_name ?? "",
|
firstName: name,
|
||||||
lastName: claims.family_name ?? "",
|
lastName: claims.family_name ?? "",
|
||||||
orgId: org.id,
|
orgId: org.id,
|
||||||
groups,
|
groups,
|
||||||
|
|||||||
Reference in New Issue
Block a user