Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bosschaert committed Feb 18, 2025
1 parent 38bb49f commit bd3a73d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pkgs/spacecat-shared-http-utils/src/auth/handlers/ims.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ const getDBRoles = async (dbClient, { imsUserId, imsOrgId }) => {

const getAcls = async (profile) => {
// Strangely the ID is in profile.email, because that's not an email at all
const imsUserId = profile.email;
const imsOrgIdEmail = profile.aa_id;
const imsUserId = profile.userId;
const imsOrgIdEmail = profile.organizations[0];
const imsOrgId = imsOrgIdEmail?.split('@')[0];

const dbClient = new DynamoDBClient();
Expand Down Expand Up @@ -216,17 +216,13 @@ export default class AdobeImsHandler extends AbstractHandler {
}

try {
try {
const imspr = await context.imsClient.getImsUserProfile(token);
console.log('§§§ ims profile:', imspr);
} catch (e) {
console.log('§§§ ims profile error:', e);
}
const imspr = await context.imsClient.getImsUserProfile(token);
console.log('§§§ ims profile:', JSON.stringify(imspr));
const acls = await getAcls(imspr);

const config = loadConfig(context);
const payload = await this.#validateToken(token, config);
const profile = transformProfile(payload);
const acls = await getAcls(profile);

return new AuthInfo()
.withType(this.name)
Expand Down

0 comments on commit bd3a73d

Please sign in to comment.