i have an open id provider and i use this provider as identity broker of keycloak. I want to map roles (claims) which sent from broker to keycloak (and keycloak will sent mapped roles in its jwt). I want to know how to implement and add a custom mapper to keycloak (like hardcodedmapper, attributemapper in keycloak). Can i do this? Thanks
相关问题
- How to get Spring to wire my JmsComponent
- Browser cache files not getting updated after a ne
- JBoss EAP 7.1 Spring-Data-JPA CDI Extension
- Disable Keycloak authentication for a specific url
- SSL redirection from Apache to Wildfly
相关文章
- Intermittent “sslv3 alert handshake failure” under
- What versions of Jackson are allowed in JBoss 6.4.
- Didn't find publicKey for kid ,Keycloak?
- jboss war deployed listener
- Keycloak Admin Client within Quarkus - java.lang.I
- JBoss AS 5 database connection pool re-connect rou
- JBPM 6.2. How to deploy a workflow directly from E
- How do I tell JBoss 4.2.3.GA to load jars in my wa
I had to do something slightly different in order to get my custom mapper working with the latest version of Keycloak (4.8 at time of writing this):
Created a custom mapper that extends
AbstractOIDCProtocolMapper
:In
src/main/resources
, create a folder structureMETA-INF/services
Create a file called
org.keycloak.protocol.ProtocolMapper
inMETA-INF/services
directory. Its contents should be just one line containing the fully qualified class name of your custom mapper:Under the
META-INF
folder insrc/main/resources
(one up fromservices
), create a file calledjboss-deployment-structure.xml
. Depending on what you're doing, you will need to add the appropriate JBoss modules here. For my simple test mapper, I used:Create your new
provider
class, I extended the existingorg.keycloak.broker.saml.mappers.AttributeToRoleMapper
class.When building your jar ensure you have a folder called services within the jars, META-INF folder.
Within this folder create a simple text file called
org.keycloak.broker.provider.IdentityProviderMapper
, within that file add the full name of your new provider class, i.e.package.Classname
.Once compiled drop the file in the providers folder below the Keycloak root folder. Restart your container.