mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 09:54:00 +00:00
azure mapping
This commit is contained in:
@@ -44,6 +44,38 @@ const PROVIDER_MAPPING: {
|
|||||||
};
|
};
|
||||||
return req;
|
return req;
|
||||||
},
|
},
|
||||||
|
[ProviderSlug.AZURE]: (idp: IDPInformation) => {
|
||||||
|
const rawInfo = idp.rawInformation?.toJson() as {
|
||||||
|
User: {
|
||||||
|
email: string;
|
||||||
|
name?: string;
|
||||||
|
given_name?: string;
|
||||||
|
family_name?: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const idpLink: PartialMessage<IDPLink> = {
|
||||||
|
idpId: idp.idpId,
|
||||||
|
userId: idp.userId,
|
||||||
|
userName: idp.userName,
|
||||||
|
};
|
||||||
|
|
||||||
|
const req: PartialMessage<AddHumanUserRequest> = {
|
||||||
|
username: idp.userName,
|
||||||
|
email: {
|
||||||
|
email: rawInfo.User?.email,
|
||||||
|
verification: { case: "isVerified", value: true },
|
||||||
|
},
|
||||||
|
// organisation: Organisation | undefined;
|
||||||
|
profile: {
|
||||||
|
displayName: rawInfo.User?.name ?? "",
|
||||||
|
givenName: rawInfo.User?.given_name ?? "",
|
||||||
|
familyName: rawInfo.User?.family_name ?? "",
|
||||||
|
},
|
||||||
|
idpLinks: [idpLink],
|
||||||
|
};
|
||||||
|
return req;
|
||||||
|
},
|
||||||
[ProviderSlug.GITHUB]: (idp: IDPInformation) => {
|
[ProviderSlug.GITHUB]: (idp: IDPInformation) => {
|
||||||
const rawInfo = idp.rawInformation?.toJson() as {
|
const rawInfo = idp.rawInformation?.toJson() as {
|
||||||
email: string;
|
email: string;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export type Item = {
|
|||||||
export enum ProviderSlug {
|
export enum ProviderSlug {
|
||||||
GOOGLE = "google",
|
GOOGLE = "google",
|
||||||
GITHUB = "github",
|
GITHUB = "github",
|
||||||
|
AZURE = "microsoft",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const demos: { name: string; items: Item[] }[] = [
|
export const demos: { name: string; items: Item[] }[] = [
|
||||||
|
|||||||
@@ -102,7 +102,13 @@ export function SignInWithIDP({
|
|||||||
return (
|
return (
|
||||||
<SignInWithAzureAD
|
<SignInWithAzureAD
|
||||||
key={`idp-${i}`}
|
key={`idp-${i}`}
|
||||||
onClick={() => alert("TODO: unimplemented")}
|
onClick={() =>
|
||||||
|
startFlow(idp.id, ProviderSlug.AZURE).then(
|
||||||
|
({ authUrl }) => {
|
||||||
|
router.push(authUrl);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
></SignInWithAzureAD>
|
></SignInWithAzureAD>
|
||||||
);
|
);
|
||||||
case 10: // IdentityProviderType.IDENTITY_PROVIDER_TYPE_GOOGLE:
|
case 10: // IdentityProviderType.IDENTITY_PROVIDER_TYPE_GOOGLE:
|
||||||
|
|||||||
Reference in New Issue
Block a user