Skip to content

Allow Use of Roles Field With Cognito Auth if Present #852

Open
@noce2

Description

@noce2

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

I would like to use the full Cognito setup for Authentication and RBAC described in the docs, however it doesn't work for my use case because I have a SAML identity provider configured on my UserPool which adds the relevant group of the user as a custom attribute in the Access Token.

To work around this, I have had to configure RBAC as follows:

        custom-params:
          type: oauth
          roles-field: mynamespace:attribute

The downside of this is that my logout functionality does not work and I get the below because the cognito logout url cannot be specified.

Image

Describe the feature you're interested in

Looking through

List<String> groups = principal.getAttribute(COGNITO_GROUPS_ATTRIBUTE_NAME);

I would like to allow an attribute name to be specified as is done for the OAuth

var rolesFieldName = provider.getCustomParams().get(ROLES_FIELD_PARAM_NAME);

falling back to the specified default above if it is unset.

I would be happy to work on this and raise a PR if this is approved.

Describe alternatives you've considered

No response

Version you're running

4cf17a0 v1.1.0

Additional context

No response

Metadata

Metadata

Assignees

Labels

area/authApp authentication related issuesscope/backendRelated to backend changesstatus/triage/completedAutomatic triage completedtype/enhancementEn enhancement/improvement to an already existing feature

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions