Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudtrust/keycloak-client-mappers
Extra mappers for keycloak clients
https://github.com/cloudtrust/keycloak-client-mappers
Last synced: about 1 month ago
JSON representation
Extra mappers for keycloak clients
- Host: GitHub
- URL: https://github.com/cloudtrust/keycloak-client-mappers
- Owner: cloudtrust
- License: agpl-3.0
- Archived: true
- Created: 2018-05-28T15:38:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-19T12:55:55.000Z (about 6 years ago)
- Last Synced: 2024-02-10T10:09:47.745Z (5 months ago)
- Language: Java
- Size: 27.3 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-keycloak - Script based ProtocolMapper extension for SAML
README
# keycloak-client-mappers
This module contains extra client mappers to be added to Keycloak. Ultimatly, such mappers should be submitted to be
integrated into Keycloak.Currently, the module contains the following mappers:
* JavaScript mapper for SAML: This mapper is analogous to the OIDC script mapper, allowing the use of JavaScript to add
attribute values to SAML tokens.This module is currently working on 3.4.3.Final.
## How to Install
### Copy files
This is an example with keycloak available at /opt/keycloak
```Bash
#Create layer in keycloak setup
install -d -v -m755 /opt/keycloak/modules/system/layers/client-mappers -o keycloak -g keycloak#Setup the module directory
install -d -v -m755 /opt/keycloak/modules/system/layers/client-mappers/io/cloudtrust/keycloak-client-mappers/main/ -o keycloak -g keycloak#Install jar
install -v -m0755 -o keycloak -g keycloak -D target/keycloak-client-mappers-3.4.3.Final.jar /opt/keycloak/modules/system/layers/client-mappers/io/cloudtrust/keycloak-client-mappers/main/#Install module file
install -v -m0755 -o keycloak -g keycloak -D module.xml /opt/keycloak/modules/system/layers/client-mappers/io/cloudtrust/keycloak-client-mappers/main/```
### Enable module & load theme
__layers.conf__
```Bash
layers=keycloak,client-mappers
```__standalone.xml__
```xml
...
authmodule:io.cloudtrust.keycloak-client-mappers
......
```## How to use
### JavaScript mapper for SAML
It's use is almost analog to the OIDC script mapper: the
[nashorn javascript engine](https://docs.oracle.com/javase/10/nashorn/introduction.htm#JSNUG136) is used to
evaluate the input script, and the last statement is the value that will be returned in the SAML attribute. The
sole difference to the OIDC varient is that the JavaScript mapper for SAML can handle Iterables or arrays as a return
value: the result will either be multiple attributes, or a single attribute with a grouped value, depending on the
value of the **Single Group Attribute** option.