We recently upgraded our KeyCloak instances to version 9 from 7, but in the upgrade, some of our redirect URIs embedded in KeyCloak calls started breaking. Specifically, if the URI was a relative path (ie: ‘/our-app/’), KeyCloak would say it’s an invalid redirect-URI when it tried to redirect. In order to fix the issue, the redirect-URI had to be altered to be fully-qualified (ie: ‘https://ourserver/our-app/’). This is the client config for the specific client with the issue in our realm:
{
"clientId": "app-portal",
"enabled": true,
"name": "App Portal",
"publicClient": true,
"redirectUris": ["/our-app", "/our-app/*"],
"protocolMappers": [
{
"name": "expose-user-id-attribute",
"protocol": "openid-connect",
"protocolMapper": "oidc-usermodel-attribute-mapper",
"consentRequired": false,
"config": {
"userinfo.token.claim": "true",
"user.attribute": "userId",
"id.token.claim": "true",
"access.token.claim": "true",
"claim.name": "attributes.userId",
"jsonType.label": "String"
}
},
{
"name": "expose-group-id-attribute",
"protocol": "openid-connect",
"protocolMapper": "oidc-usermodel-attribute-mapper",
"consentRequired": false,
"config": {
"userinfo.token.claim": "true",
"user.attribute": "groupId",
"id.token.claim": "true",
"access.token.claim": "true",
"claim.name": "attributes.groupId",
"jsonType.label": "String"
}
}
]
},
Any suggestions about what might be going wrong would be helpful. The only change made to the KeyCloak config on upgrade was changing the KeyCloak docker container version to 9.0.3, so whatever settings we had worked for 7, but don’t anymore with 9.
NOTE: The folks who set up our KeyCloak container originally are no longer with the company, so it’s possible that things were never configured correctly, but KeyCloak 7 didn’t care.