Skip to content

Commit

Permalink
Add protocol mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Threated committed Nov 2, 2023
1 parent b2ecd3c commit 5fb95f5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion central/src/keycloak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn get_access_token(conf: &KeyCloakConfig) -> Result<String> {
#[tokio::test]
async fn test_create_client() -> Result<()> {
let conf = KeyCloakConfig {
keycloak_url: "http:localhost:1337".parse().unwrap(),
keycloak_url: "http://localhost:1337".parse().unwrap(),
keycloak_id: "".to_owned(),
keycloak_secret: "".to_owned(),
keycloak_realm: "master".to_owned(),
Expand Down Expand Up @@ -87,6 +87,17 @@ async fn post_client(
"microprofile-jwt",
"groups"
],
"protocolMappers": [{
"name": format!("aud-mapper-{name}"),
"protocol": "openid-connect",
"protocolMapper": "oidc-audience-mapper",
"consentRequired": false,
"config": {
"included.client.audience": name,
"id.token.claim": "true",
"access.token.claim": "true"
}
}]
}))
.send()
.await?;
Expand Down

0 comments on commit 5fb95f5

Please sign in to comment.