Skip to content

How can I properly integrate this with user groups? #47

Description

@pablote

Describe the bug?

I need to receive groups information for the authenticated user. Based on the docs I added the groups scope on the ExpressOIDC initialization, and by doing this I'm receiving a list of groups the authenticated users belongs to.

The problem is, any change done in Okta, wether removing or adding a group to a user, has no impact on the list of groups I get on the user I get from the middleware, it's like it's stuck on whatever groups it had the moment it logged in.

What would be the right way to get an up to date list of groups an authenticated user belongs to? Is this something I can do at the application level, or it must be supported withing this lib?

What is expected to happen?

req.userContext.groups contains an up to date list of user's groups when a new request comes in

What is the actual behavior?

req.userContext.groups is stuck at whatever groups the user had the moment it logged in

Reproduction Steps?

Just add the groups scope to the ExpressOIDC constructor on the scope property.

SDK Versions

@okta/oidc-middleware: 4.5.1

Execution Environment

NodeJs v14. MacOS 12 for development, node:14-alpine docker image for deployed environments.

Additional Information?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions