I am trying to setup OIDC module, and I experience some problems.
My CAS server (let's name it "appserver.my.domain") is running on port 8080, with HAProxy exposing public URLs (let's name it "public.my.domain").
So after rebuilding the webapp including "org.apereo.cas:cas-server-support-oidc", I have added the following lines to my working "cas.properties" :
cas.authn.oauth.crypto.encryption.key=0ZJCKvFSVO6PUKlzUqWzE5eXDerK_T7G1oSfGHfaAGM
cas.authn.oauth.crypto.signing.key=_d6j3pacsAy_V7WP55RB-H0HtwfSawKav6aV8rUPuRPBDqDhAeJXpqjrtZwqTiUPkNOz2jcb5nLqJJ73ygqROw
cas.authn.oauth.access-token.crypto.encryption.key=8wK97XDbYzeDhSzZgfcFWp3SHW_Lr-h69cGtWYZjJz0
Is it Ok ?
Then I have then added a basic servcice :
{
"@class" : "org.apereo.cas.services.OidcRegisteredService",
"scopes" : [ "java.util.HashSet", [ "profile", "openid", "email" ] ],
"clientId": "client",
"clientSecret": "secret",
"serviceId" : "
http://localhost:8080/(.*)",
"name" : "test",
"id" : 2,
"idTokenIssuer": "
https://public.my.domain/cas/oidc"
}
It seems to be working :
2024-01-17 11:04:01,722 DEBUG [org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry] - <Attempting to read and parse [/etc/cas/services/002_OIDC.json]>
2024-01-17 11:04:01,722 DEBUG [org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry] - <Attempting to read and parse [/etc/cas/services/002_OIDC.json]>
2024-01-17 11:04:01,722 DEBUG [org.apereo.cas.oidc.services.OidcServiceRegistryListener] - <Scope [openid] is found for service [2]>
2024-01-17 11:04:01,722 DEBUG [org.apereo.cas.oidc.services.OidcServiceRegistryListener] - <Mapped [email] to attribute release policy [OidcEmailScopeAttributeReleasePolicy]>
2024-01-17 11:04:01,722 DEBUG [org.apereo.cas.oidc.services.OidcServiceRegistryListener] - <Mapped [profile] to attribute release policy [OidcProfileScopeAttributeReleasePolicy]>
When I try to reach the app's main URL (
http://localhost:8080/), I am redirected to CAS but I get the follwing exception : "java.lang.IllegalArgumentException: Unable to locate authentication profile"
And on server side :
2024-01-17 11:03:48,217 DEBUG [org.springframework.security.web.FilterChainProxy] - <Securing GET /oidc/oidcAuthorize?nonce=cddf2055bdb501ea76a4d95d9a58d2ba&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=openid%20email%20profile&client_id=client&state=813b1409ca966667f5f820e6923ff284>
2024-01-17 11:03:48,217 DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - <Mapped to org.apereo.cas.oidc.web.controllers.authorize.OidcAuthorizeEndpointController#handleRequest(HttpServletRequest, HttpServletResponse)>
2024-01-17 11:03:48,218 DEBUG [org.springframework.security.web.FilterChainProxy] - <Secured GET /oidc/oidcAuthorize?nonce=cddf2055bdb501ea76a4d95d9a58d2ba&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=openid%20email%20profile&client_id=client&state=813b1409ca966667f5f820e6923ff284>
2024-01-17 11:03:48,218 DEBUG [org.springframework.web.servlet.DispatcherServlet] - <GET "/cas/oidc/oidcAuthorize?nonce=cddf2055bdb501ea76a4d95d9a58d2ba&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=openid%20email%20profile&client_id=client&state=813b1409ca966667f5f820e6923ff284", parameters={masked}>
2024-01-17 11:03:48,218 DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - <Mapped to org.apereo.cas.oidc.web.controllers.authorize.OidcAuthorizeEndpointController#handleRequest(HttpServletRequest, HttpServletResponse)>
2024-01-17 11:03:48,220 DEBUG [org.apereo.cas.web.FlowExecutionExceptionResolver] - <Ignoring the received exception [java.lang.IllegalArgumentException: Unable to locate authentication profile] due to a type mismatch with handler [org.apereo.cas.oidc.web.controllers.authorize.OidcAuthorizeEndpointController#handleRequest(HttpServletRequest, HttpServletResponse)]>
2024-01-17 11:03:48,220 DEBUG [org.apereo.cas.web.FlowExecutionExceptionResolver] - <Ignoring the received exception [java.lang.IllegalArgumentException: Unable to locate authentication profile] due to a type mismatch with handler [org.apereo.cas.oidc.web.controllers.authorize.OidcAuthorizeEndpointController#handleRequest(HttpServletRequest, HttpServletResponse)]>
at org.apereo.cas.oidc.web.controllers.authorize.OidcAuthorizeEndpointController.handleRequest(OidcAuthorizeEndpointController.java:58) ~[cas-server-support-oidc-core-api-6.6.10.jar!/:6.6.10]
Can someone tell me what this error clearly means ? I had a look at the source code, but found nothing obvious.
Is there something wrong or missing with the configuration above ?
Thanks for any kind of help
Regards