By: Moacyr Silva Neto named 11 May 2021 at 8:15 a.m. CDT

2 Responses
Moacyr Silva Neto gravatar
Hello! We are trying to obtain an access_token (/token) to create consent (/consents), using client_credentials, but there is no sessionId.getSessionAttributes().get(“openbanking_intent_id”) as expected in introspection script, can you help us better understand how to fix this issue? Here are the logs ``` 2021-05-11 12:55:43,233 DEBUG [qtp1422222071-15] [io.jans.as.server.service.ClientService] (ClientService.java:143) - Found 1 entries for client id = c98f9eaf-eba5-4b7a-ac43-d9edf9395076 2021-05-11 12:55:43,233 DEBUG [qtp1422222071-15] [io.jans.as.server.auth.MTLSService] (MTLSService.java:66) - Trying to authenticate client c98f9eaf-eba5-4b7a-ac43-d9edf9395076 via tls_client_auth ... 2021-05-11 12:55:43,234 DEBUG [qtp1422222071-15] [io.jans.as.server.auth.MTLSService] (MTLSService.java:87) - Authenticating with tls_client_auth ... 2021-05-11 12:55:43,234 DEBUG [qtp1422222071-15] [io.jans.as.server.auth.MTLSService] (MTLSService.java:100) - Client c98f9eaf-eba5-4b7a-ac43-d9edf9395076 authenticated via `tls_client_auth`. 2021-05-11 12:55:43,236 DEBUG [qtp1422222071-15] [io.jans.as.server.service.ClientService] (ClientService.java:143) - Found 1 entries for client id = c98f9eaf-eba5-4b7a-ac43-d9edf9395076 2021-05-11 12:55:43,240 DEBUG [qtp1422222071-15] [as.server.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:134) - Attempting to request access token: grantType = client_credentials, code = null, redirectUri = null, username = null, refreshToken = null, clientId = c98f9eaf-eba5-4b7a-ac43-d9edf9395076, ExtraParams = {client_secret=[86acfa6c-6326-4f1a-9b02-96c343ea315b], grant_type=[client_credentials], client_id=[c98f9eaf-eba5-4b7a-ac43-d9edf9395076], scope=[consents]}, isSecure = true, codeVerifier = null, ticket = null 2021-05-11 12:55:43,240 DEBUG [qtp1422222071-15] [as.server.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:156) - Starting to validate request parameters 2021-05-11 12:55:43,240 DEBUG [qtp1422222071-15] [as.server.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:164) - Grant type: 'client_credentials' 2021-05-11 12:55:43,240 DEBUG [qtp1422222071-15] [as.server.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:170) - Get sessionClient: 'io.jans.as.server.model.session.SessionClient@5cb4b1d5' 2021-05-11 12:55:43,241 DEBUG [qtp1422222071-15] [as.server.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:177) - Get client from session: 'c98f9eaf-eba5-4b7a-ac43-d9edf9395076' 2021-05-11 12:55:43,242 DEBUG [qtp1422222071-15] [jans.as.server.model.authorize.ScopeChecker] (ScopeChecker.java:61) - Checking scopes policy for: [consents] 2021-05-11 12:55:43,250 DEBUG [qtp1422222071-15] [jans.as.server.model.authorize.ScopeChecker] (ScopeChecker.java:93) - Granted scopes: [] 2021-05-11 12:55:43,263 ERROR [qtp1422222071-15] [jans.as.server.service.external.ExternalIntrospectionService] (ExternalIntrospectionService.java:104) - AttributeError: 'NoneType' object has no attribute 'getSessionAttributes' org.python.core.PyException: AttributeError: 'NoneType' object has no attribute 'getSessionAttributes' at org.python.core.Py.AttributeError(Py.java:178) ~[jython-standalone-2.7.2.jar:2.7.2] at org.python.core.PyObject.noAttributeError(PyObject.java:965) ~[jython-standalone-2.7.2.jar:2.7.2] at org.python.core.PyObject.__getattr__(PyObject.java:959) ~[jython-standalone-2.7.2.jar:2.7.2] ... 2021-05-11 12:55:43,278 DEBUG [qtp1422222071-15] [jans.as.server.service.external.ExternalIntrospectionService] (ExternalIntrospectionService.java:84) - Stopped running external interception scripts because script introspection returns false. 2021-05-11 12:55:43,280 ERROR [qtp1422222071-15] [io.jans.as.model.crypto.AuthCryptoProvider] (AuthCryptoProvider.java:269) - Failed to find private key by kid: SFdt20jt7DXkDSEAY8ht3uocTcoC9rs5VJ7_iO1hpm4, signatureAlgorithm: RS256(check whether web keys JSON in persistence corresponds to keystore file), keySelectionStrategy: OLDER 2021-05-11 12:55:43,280 ERROR [qtp1422222071-15] [jans.as.server.model.common.AuthorizationGrant] (AuthorizationGrant.java:197) - Failed to find private key by kid: SFdt20jt7DXkDSEAY8ht3uocTcoC9rs5VJ7_iO1hpm4, signatureAlgorithm: RS256(check whether web keys JSON in persistence corresponds to keystore file), keySelectionStrategy: OLDER java.lang.IllegalStateException: Failed to find private key by kid: SFdt20jt7DXkDSEAY8ht3uocTcoC9rs5VJ7_iO1hpm4, signatureAlgorithm: RS256(check whether web keys JSON in persistence corresponds to keystore file), keySelectionStrategy: OLDER at io.jans.as.model.crypto.AuthCryptoProvider.sign(AuthCryptoProvider.java:270) ~[jans-auth-model-1.0.0-SNAPSHOT.jar:?] at io.jans.as.model.crypto.AbstractCryptoProvider$Proxy$_$$_WeldClientProxy.sign(Unknown Source) ~[jans-auth-model-1.0.0-SNAPSHOT.jar:?] ... at java.lang.Thread.run(Thread.java:834) [?:?] 2021-05-11 12:55:43,287 ERROR [qtp1422222071-15] [as.server.token.ws.rs.TokenRestWebServiceImpl] (TokenRestWebServiceImpl.java:543) - null java.lang.NullPointerException: null at io.jans.as.server.token.ws.rs.TokenRestWebServiceImpl.requestAccessToken(TokenRestWebServiceImpl.java:345) ~[classes/:?] at io.jans.as.server.token.ws.rs.TokenRestWebServiceImpl$Proxy$_$$_WeldClientProxy.requestAccessToken(Unknown Source) ~[classes/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] ``` Thank you.

By Madhumita Subramaniam staff 11 May 2021 at 9:57 p.m. CDT

Madhumita Subramaniam gravatar
Hi Take a look at the PersonAuthentication script where the intent id is set in the first place in the line identity.setWorkingParameter("openbanking_intent_id", "the value"). The flow is as follows 1. When /authorize endpoint is called, the openbanking_intent_id is set in the request object / URL parameters. 2. It is extracted in the person authentication script and set to session. 3. When the introspection scripts / update token script (for retaining id_token claims) are called, these values are set in the claims which are a part of access token , id_token respectively.

By Moacyr Silva Neto named 12 May 2021 at 12:54 p.m. CDT

Moacyr Silva Neto gravatar
We will take a look into this flow! Thank you!