mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 05:06:55 +00:00
azure mapping
This commit is contained in:
@@ -44,6 +44,38 @@ const PROVIDER_MAPPING: {
|
||||
};
|
||||
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) => {
|
||||
const rawInfo = idp.rawInformation?.toJson() as {
|
||||
email: string;
|
||||
|
||||
@@ -7,6 +7,7 @@ export type Item = {
|
||||
export enum ProviderSlug {
|
||||
GOOGLE = "google",
|
||||
GITHUB = "github",
|
||||
AZURE = "microsoft",
|
||||
}
|
||||
|
||||
export const demos: { name: string; items: Item[] }[] = [
|
||||
|
||||
@@ -102,7 +102,13 @@ export function SignInWithIDP({
|
||||
return (
|
||||
<SignInWithAzureAD
|
||||
key={`idp-${i}`}
|
||||
onClick={() => alert("TODO: unimplemented")}
|
||||
onClick={() =>
|
||||
startFlow(idp.id, ProviderSlug.AZURE).then(
|
||||
({ authUrl }) => {
|
||||
router.push(authUrl);
|
||||
},
|
||||
)
|
||||
}
|
||||
></SignInWithAzureAD>
|
||||
);
|
||||
case 10: // IdentityProviderType.IDENTITY_PROVIDER_TYPE_GOOGLE:
|
||||
|
||||
Reference in New Issue
Block a user