Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Please add "saml-role-list-mapper" #625

Closed
Moep90 opened this issue Oct 28, 2021 · 2 comments
Closed

[FEATURE] Please add "saml-role-list-mapper" #625

Moep90 opened this issue Oct 28, 2021 · 2 comments

Comments

@Moep90
Copy link

Moep90 commented Oct 28, 2021

We're adopting gitlab with SSO using SAML (since OIDC is not supported for groups...).

Sample Request for saml-role-list-mapper:
image

I hope it can be easily adopted via:
https://github.com/mrparkers/terraform-provider-keycloak/blob/master/keycloak/saml_user_property_protocol_mapper.go

Stolen from: #569

[...]
    {
        "id": "be741641-d8f1-47ab-985b-9384b62b8ea7",
        "name": "Allowed Protocol Mapper Types",
        "providerId": "allowed-protocol-mappers",
        "providerType": "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy",
        "parentId": "agent",
        "subType": "authenticated",
        "config": {
            "allowed-protocol-mapper-types": [
                **"saml-user-property-mapper",**
                "saml-role-list-mapper",
                "oidc-address-mapper",
                "oidc-full-name-mapper",
                "oidc-usermodel-attribute-mapper",
                "oidc-usermodel-property-mapper",
                "oidc-sha256-pairwise-sub-mapper",
                "saml-user-attribute-mapper"
            ]
        }
    },
[...]
@jeremymcgee73
Copy link

You can do this without having this added. You can use the keycloak_generic_client_protocol_mapper resource. I just got this working with AWS a bit ago.

resource "keycloak_generic_client_protocol_mapper" "aws-role" {
  realm_id        = data.keycloak_realm.realm_name.id
  client_id       = keycloak_saml_client.saml_client.id
  name            = "Session Role"
  protocol        = "saml"
  protocol_mapper = "saml-role-list-mapper"
  config = {
    "attribute.name"       = "https://aws.amazon.com/SAML/Attributes/Role"
    "attribute.nameformat" = "Basic"
    "friendly.name"        = "Session Role"
    "single"               = "true"
  }
}

@Moep90
Copy link
Author

Moep90 commented Nov 16, 2021

@jeremymcgee73 works like a charm! Thx for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants