<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00006sih19SAAOkta Classic EngineSingle Sign-OnAnswered2024-04-15T09:55:42.000Z2019-10-27T12:27:09.000Z2019-11-09T02:56:34.000Z

mlo4o (mlo4o) asked a question.

Return user's groups in SAML profile

I'm writing a NodeJS app that uses the `passport-saml` package to get user profiles:

```js

 passport.use(

   new SamlStrategy({ cert, entryPoint, path }, function authCb(user, done) {

     try {

       const profile = formatUser(user);

       return profile ? done(null, profile) : done('No User!');

     } catch (error) {

       done(error);

     }

   })

 );

```

I'd very much like to get an Array of user's groups back in the `profile`

I've added the following "Attribute Expression" to the App's configuration page:

```

Name  Name Format  Value

email Unspecified ${user.email}

firstName Unspecified ${user.firstName}

lastName Unspecified ${user.lastName}

groups  Unspecified getFilteredGroups({"user.id"},"group.name",40)

```

 

However, in `authCb`, the `user` object has no `groups` property.

 

Have I misconfigured this? Are there more steps that need to be taken?


This question is closed.
Loading
Return user's groups in SAML profile