Skip to content

Commit

Permalink
Change mapping between okta user and cams user ref
Browse files Browse the repository at this point in the history
Jira ticket: CAMS-283
  • Loading branch information
btposey committed Sep 18, 2024
1 parent bb65a3c commit 2dd8872
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function initialize(config: UserGroupGatewayConfig): Promise<Client
clientId: config.clientId,
authorizationMode: 'PrivateKey',
scopes: ['okta.groups.read'],
privateKey: config.privateKey,
privateKey: JSON.parse(config.privateKey),
keyId: config.keyId,
};
if (!singleton) {
Expand Down Expand Up @@ -124,8 +124,10 @@ async function getUserGroupUsers(

for await (const oktaUser of oktaUsers) {
camsUserReferences.push({
id: oktaUser.id,
name: oktaUser.profile.displayName,
id: oktaUser.profile.login,
name:
oktaUser.profile.displayName ??
oktaUser.profile.lastName + ', ' + oktaUser.profile.firstName,
});
}
} catch (originalError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ async function testOktaGroupApi() {
console.log(`${group.name} users`, users, '\n');
}
} catch (error) {
console.error(error);
console.error(error, '\n');
} finally {
console.log('Done', '\n');
}
}

Expand Down

0 comments on commit 2dd8872

Please sign in to comment.