european-commission-empl / european-digital-credentials

European Union Public License 1.2
5 stars 3 forks source link

401 error when trying to log into issuer #10

Open lemoustachiste opened 10 months ago

lemoustachiste commented 10 months ago

I'm trying to set up the issuer image.

I've used the global docker-compose file to set things up so keycloak is installed (and its interface accessible at localhost:9000).

I've set the oidc.mock.user.active property to true, restarted the docker builds and it still fails.

Here are the logs:

issuer    |  [org.springframework.security.web.FilterChainProxy$VirtualFilterChain](Line: 328)2023-10-05 15:05:35 DEBUG - /auth/oidc/eulogin at position 6 of 14 in additional filter chain; firing Filter: 'OAuth2AuthenticationProcessingFilter'
issuer    |  [org.springframework.security.oauth2.provider.authentication.BearerTokenExtractor](Line: 58)2023-10-05 15:05:35 DEBUG - Token not found in headers. Trying request parameters.
issuer    |  [org.springframework.security.oauth2.provider.authentication.BearerTokenExtractor](Line: 61)2023-10-05 15:05:35 DEBUG - Token not found in request parameters.  Not an OAuth2 request.
issuer    |  [org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter](Line: 145)2023-10-05 15:05:35 DEBUG - No token in request, will continue chain.
issuer    |  [org.springframework.security.web.FilterChainProxy$VirtualFilterChain](Line: 328)2023-10-05 15:05:35 DEBUG - /auth/oidc/eulogin at position 7 of 14 in additional filter chain; firing Filter: 'EDCIOIDCAuthenticationFilter'
issuer    |  [org.springframework.security.web.util.matcher.AntPathRequestMatcher](Line: 177)2023-10-05 15:05:35 DEBUG - Checking match of request : '/auth/oidc/eulogin'; against '/auth/oidc/eulogin'
issuer    |  [org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter](Line: 206)2023-10-05 15:05:35 DEBUG - Request is to process authentication
issuer    |  [org.springframework.jndi.JndiTemplate](Line: 155)2023-10-05 15:05:35 DEBUG - Looking up JNDI object with name [java:comp/env/oidc.mock.user.active]
issuer    |  [org.springframework.jndi.JndiLocatorSupport](Line: 102)2023-10-05 15:05:35 DEBUG - Converted JNDI name [java:comp/env/oidc.mock.user.active] not found - trying original name [oidc.mock.user.active]. javax.naming.NameNotFoundException: Name [oidc.mock.user.active] is not bound in this Context. Unable to find [oidc.mock.user.active].
issuer    |  [org.springframework.jndi.JndiTemplate](Line: 155)2023-10-05 15:05:35 DEBUG - Looking up JNDI object with name [oidc.mock.user.active]
issuer    |  [org.springframework.jndi.JndiPropertySource](Line: 101)2023-10-05 15:05:35 DEBUG - JNDI lookup for name [oidc.mock.user.active] threw NamingException with message: Name [oidc.mock.user.active] is not bound in this Context. Unable to find [oidc.mock.user.active].. Returning null.
issuer    |  [org.springframework.core.env.PropertySourcesPropertyResolver](Line: 115)2023-10-05 15:05:35 DEBUG - Found key 'oidc.mock.user.active' in PropertySource 'URL [file:/usr/local/tomcat/conf/edci/issuer/security.properties]' with value of type String
issuer    |  [eu.europa.ec.empl.edci.security.oidc.filter.EDCIOIDCAuthenticationFilter](Line: 126)2023-10-05 15:05:35 DEBUG - OIDC - Starting redirection to ECAS for session 3E6B6194CE19B95255B4E92816C0EF2E, url to redirect will be null
issuer    |  [org.springframework.core.log.CompositeLog](Line: 147)2023-10-05 15:05:36 DEBUG - HTTP GET http://host.docker.internal:9000/realms/edci/.well-known/openid-configuration
issuer    |  [org.springframework.core.log.CompositeLog](Line: 147)2023-10-05 15:05:36 DEBUG - Accept=[text/plain, application/xml, text/xml, application/json, application/*+xml, application/*+json, */*]
issuer    |  [org.springframework.core.log.CompositeLog](Line: 147)2023-10-05 15:05:36 DEBUG - Response 404 NOT_FOUND
issuer    |  [org.mitre.openid.connect.client.service.impl.DynamicServerConfigurationService](Line: 123)2023-10-05 15:05:36 WARN  - Couldn't load configuration for http://host.docker.internal:9000/realms/edci: com.google.common.util.concurrent.UncheckedExecutionException: org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: "{"error":"Realm does not exist"}"
issuer    |  [eu.europa.ec.empl.edci.security.oidc.filter.EDCIOIDCAuthenticationFilter](Line: 156)2023-10-05 15:05:36 ERROR - No server configuration found for issuer: http://host.docker.internal:9000/realms/edci

I couldn't find documentation about setting up keycloak on this repo? Could you point me in the right direction?

Thanks a lot

anthonycamilleri commented 10 months ago

@lemoustachiste we will get back to you shortly on this.