Adjust SCIM and SAML impl to use username / nameID, patch LDAP edge-cases

This commit is contained in:
Tuan Dang
2024-02-25 18:16:26 -08:00
parent 8c31566e17
commit a33c50b75a
15 changed files with 136 additions and 82 deletions
+13 -9
View File
@@ -28,12 +28,12 @@ export const buildScimUser = ({
}: {
userId: string;
username: string;
email: string;
email?: string | null;
firstName: string;
lastName: string;
active: boolean;
}): TScimUser => {
return {
const scimUser = {
schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"],
id: userId,
userName: username,
@@ -43,13 +43,15 @@ export const buildScimUser = ({
middleName: null,
familyName: lastName
},
emails: [
{
primary: true,
value: email,
type: "work"
}
],
emails: email
? [
{
primary: true,
value: email,
type: "work"
}
]
: [],
active,
groups: [],
meta: {
@@ -57,4 +59,6 @@ export const buildScimUser = ({
location: null
}
};
return scimUser;
};