PreRegistration notification with email issue

Hello,

I working on preRegistration module, after create apointenment i will send a notification with email and mobile. i have the bellow issue in preRegistration-booking-service.

Otherwise i used the default configuration like bellow and the token generated with otpwithCaptcha.

iam.base.url=${keycloak.internal.url}
auth-token-generator.rest.issuerUrl=${iam.base.url}/auth/realms/mosip
validationStatus=success
context=auth-otp
prereg.auth.jwt.secret=Yn2kjibddFAWtnPJ2AFlL8WXmohJMCvigQggaEypa5E=
prereg.auth.jwt.token.expiration=3600
prereg.auth.jwt.token.roles=INDIVIDUAL

2023-01-12 06:08:56,727 [http-nio-9095-exec-7] ERROR [i.m.k.a.d.h.CustomJWTAuthHandler].retrieveUser.56 : validate token exception io.jsonwebtoken.SignatureException: JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.
at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:342)
at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:458)
at io.jsonwebtoken.impl.DefaultJwtParser.parseClaimsJws(DefaultJwtParser.java:518)
at io.mosip.kernel.auth.defaultadapter.handler.CustomJWTAuthHandler.retrieveUser(CustomJWTAuthHandler.java:50)
at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:144)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
at io.mosip.kernel.auth.defaultadapter.filter.AuthFilter.attemptAuthentication(AuthFilter.java:147)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.cloud.sleuth.instrument.web.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at brave.servlet.TracingFilter.doFilter(TracingFilter.java:86)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at io.mosip.kernel.core.logger.config.SleuthValve.invoke(SleuthValve.java:36)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)

2023-01-12 06:08:56,729 [http-nio-9095-exec-7] INFO [i.m.k.a.d.h.ValidateTokenHelper].getPublicKey.176 : offline verification for environment profile. UserName: service-account-mosip-prereg-client
2023-01-12 06:08:56,741 [http-nio-9095-exec-7] ERROR [i.m.k.a.d.h.ValidateTokenHelper].getIssuerPublicKey.202 : Error downloading Public key from serverNo key found in http://10.87.105.140/auth/realms/mosip/protocol/openid-connect/certs with kid 7a66a76f-7d8b-4fda-90c1-f6276d232304

Did you check if this url is correct?

http://10.87.105.140/auth/realms/mosip/protocol/openid-connect/certs

This is supposed to be the keycloak URL.

1 Like

Thanks @gsasikumar for reply yes its the keyloak URL
and the response is
{
“keys”: [{
“kid”: “yNWuZ8kn4_ysa_CjXSmS8_utSMjllGo7qT9OaRHjNfY”,
“kty”: “RSA”,
“alg”: “RS256”,
“use”: “sig”,
“n”: “oiM7jB9NCAKa-n7wKC5hWcNHARiLzDkHguH1ostUyT-8Q7NRYxyKyu0mGNLNdLEb-SV9hnrTvHfTp2_VRJIGgJyp9dm2dEaPIprE-nMMgKNBq4XkBSDAmDJH1YHqYNgdpN0xj2TUTJwV-ZS4P3nI7cDblpZLZ825Rv2O1h9qbYs-h9ugIRYLRmFmi3gfOoQ5qSkcycajSbFitAZJ7U7r56QXdWyYSWkUTRsPsOjQZPuaQwFBPUZBZglapf_YvpUVQXpKdOpDGlqFrIi2kt95jHDNqUQfrRP6kbR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n8”
}, {
“kid”: “ZvxAAfPwpF4zsQObSBj246Sxelpw5iTRxloat8UALpA”,
“kty”: “RSA”,
“alg”: “RS256”,
“use”: “sig”,
“n”: “i-hwLdnOIfQ29ygFc0m51K9u7QjJj70OS1HeNkwHIrPNqdDP6wDOtfixo0xgmxwJmj1MFhHHjIsJTmFWBfYfPrJ70LLW934NLr9NzRvYfm0TpZ1plsfv0DDFML_GcAs_2YdHZ_p5SduGhjWsDHhLcOJ-Jcu8JvrdUmPH6ppb0FVALCfqSgTIp7N4xHddEPvfXWil9xjQEjxKnqeVDGDsY9d0_ysp6pJx4zCLi4YXe450L-vMNrgJWjEeVBNFobDS_nK89yDE29IPGMcCFu9LrkyYvjhancX1bxoW3KOfyU58mGnfGHBF1RFY2S-9xeTeElYo41Vrkl1FA6ZoulY_9w”,
“e”: “AQAB”,
“x5c”: [“MIICmTCCAYECBgGFpyhH4zANBgkqhkiG9w0BAQsFADAQMQ4wDAYDVQQDDAVtb3NpcDAeFw0yMzAxMTIxODAzMzNaFw0zMzAxMTIxODA1MTNaMBAxDjAMBgNVBAMMBW1vc2lwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAi+hwLdnOIfQ29ygFc0m51K9u7QjJj70OS1HeNkwHIrPNqdDP6wDOtfixo0xgmxwJmj1MFhHHjIsJTmFWBfYfPrJ70LLW934NLr9NzRvYfm0TpZ1plsfv0DDFML/GcAs/2YdHZ/p5SduGhjWsDHhLcOJ+Jcu8JvrdUmPH6ppb0FVALCfqSgTIp7N4xHddEPvfXWil9xjQEjxKnqeVDGDsY9d0/ysp6pJx4zCLi4YXe450L+vMNrgJWjEeVBNFobDS/nK89yDE29IPGMcCFu9LrkyYvjhancX1bxoW3KOfyU58mGnfGHBF1RFY2S+9xeTeElYo41Vrkl1FA6ZoulY/9wIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBlWWV8+W1mqC6tlDc2wSpIISeRFnGFEN39jz4N9CZoSS4RJnk7PXBK+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