Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ansforge/keycloak-custom-identity-provider-mapper
Keycloak OIDC mapper
https://github.com/ansforge/keycloak-custom-identity-provider-mapper
keycloak mapper oidc provider
Last synced: 8 days ago
JSON representation
Keycloak OIDC mapper
- Host: GitHub
- URL: https://github.com/ansforge/keycloak-custom-identity-provider-mapper
- Owner: ansforge
- License: apache-2.0
- Created: 2024-01-15T14:07:12.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-17T11:43:26.000Z (3 months ago)
- Last Synced: 2024-11-12T11:30:37.900Z (2 months ago)
- Topics: keycloak, mapper, oidc, provider
- Language: Java
- Homepage:
- Size: 397 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keycloak - Custom identity provider mapper
This extension provides a _Custom Mapper_ for OpenID Connect identity provider. It is a fork of _Advanced Claim to Role Mapper_, adding capability to select claims or nested claims where path includes an array field. Result of the target key is an array of values.
```
Example :
{
"claimA": {
"claimsB": [
{
"claimC": "C1",
"claimD": "D1"
},
{
"claimC": "C2",
"claimD": "D2"
}
]
}
}Key = claimA.claimsB.claimC
Value = [ "C1", "D1" ]
```Then, it allows to apply regex on result array.
## Compatibility
- Version `1.0.0` is compatible with Keycloak `22.0.X`.
- Version `2.0.0` is compatible with Keycloak `23.0.X`.
- Version `3.0.0` is compatible with Keycloak `25.0.X` (nécessite java 21).## Install
As other [Keycloak SPI](https://www.keycloak.org/docs/latest/server_development/index.html#_implementing_spi),
* put jar file in ```/providers``` folder
* if Keycloak server il already started, stop it
* to take into account this new provider, launch following command ```/bin/kc.sh build```
* and start Keycloak server again ```/bin/kc.sh start```## Settings
Connect to Keycloak admin console.
Select Identity Provider where you want to set up a new mapper :
![Select Identity Provider](/assets/keycloak-idp-mapper-1.jpg)
Click on **Add mapper** button and select **Custom Claim to Role** :
![Add new Identity Provider Mapper](/assets/keycloak-idp-mapper-2.jpg)
Set up your mapper config :
![Set Identity Provider Mapper Config](/assets/keycloak-idp-mapper-3.jpg)## Development
### Build
To build your local package, execute following command ```mvnw package```
### Container
To test a provider, set version of your provider (jar file) in .env file :
```MAPPER_VERSION=2.0.0```Then launch a Keycloak instance in a Docker container ```docker compose --env-file .env up```