By: Oliver Kabierschke user 07 Mar 2018 at 4:24 a.m. CST

2 Responses
Oliver Kabierschke gravatar
Hi there, I am having trouble accessing the SCIM API using the node.js implementation "scim-node". The response from the server is: ``` "StatusCodeError: 503 - "{"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"status":"503","scimType":"","detail":"SCIM was disabled"}"" ``` Of course I enabled "SCIM Support" and "uma_client_authz_rpt_policy" and even restarted Gluu. In the oxauth log there is the following error: ``` 2018-03-07 10:05:25,116 INFO [qtp2008017533-14] [org.xdi.oxauth.auth.AuthenticationFilter] (AuthenticationFilter.java:395) - JWT authentication failed: {} org.xdi.oxauth.model.exception.InvalidJwtException: Cannot verify the JWT at org.xdi.oxauth.model.token.ClientAssertion.<init>(ClientAssertion.java:50) ~[classes/:?] at org.xdi.oxauth.auth.AuthenticationFilter.processJwtAuth(AuthenticationFilter.java:371) [classes/:?] at org.xdi.oxauth.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:109) [classes/:?] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.Server.handle(Server.java:534) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [jetty-io-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110) [jetty-io-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.15.v20161220.jar:9.3.15.v20161220] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112] Caused by: org.xdi.oxauth.model.exception.InvalidJwtException: Invalid authentication method at org.xdi.oxauth.model.token.ClientAssertion.load(ClientAssertion.java:127) ~[classes/:?] at org.xdi.oxauth.model.token.ClientAssertion.<init>(ClientAssertion.java:44) ~[classes/:?] ... 27 more ``` I configured the SCIM client as follows: ```javascript "keyAlg": "HS256", "domain": "<The domain>", "privateKey": "./scim-rp.key", "clientId": "<client id obtained from 'cat setup.properties.last | grep scim_rp'", "keyId": "<first alias in scim-rp.jks>" ``` Can you see where the problem is? Thanks!

By Michael Schwartz Account Admin 08 Mar 2018 at 2:15 p.m. CST

Michael Schwartz gravatar
The easiest solution is to use the SCIM client credentials created during installation. You can see the LDIF that was created after installation for the client id and secret. The only supported client library is the [Java SCIM-Client](https://github.com/GluuFederation/SCIM-Client) I'm closing the issue because it's out of our support scope. But post here if you make any progress. Maybe with more information we could help.

By Oliver Kabierschke user 12 Mar 2018 at 5:56 a.m. CDT

Oliver Kabierschke gravatar
I now tried to use the Java client, but the same error appears in the oxauth.log: ``` 2018-03-12 09:56:43,975 INFO [qtp2008017533-17] [org.xdi.oxauth.auth.AuthenticationFilter] (AuthenticationFilter.java:395) - JWT authentication failed: {} org.xdi.oxauth.model.exception.InvalidJwtException: Cannot verify the JWT [...] Caused by: org.xdi.oxauth.model.exception.InvalidJwtException: Invalid authentication method [...] ``` I followed the docs: https://www.gluu.org/docs/ce/user-management/scim2/. I enabled the SCIM Support in the Organization Configuration and enabled the custom script uma_client_authz_rpt_policy. Then I got the client ID from the setup properties file. It matches the one listed in the "allowed_clients" property in the custom script "uma_client_authz_rpt_policy", so I guess I got the right one. I copied the scim-rp.jks to the root directory of my Java project and made sure, the default password "secret" works. I copied the first alias from the JKS to the variable umaAatClientKeyId in the Java program (which according to the docs is redundant). What I'm doing on the Java side is simply executing the example from the docs. When it comes to run ```client.searchUsers()```, an IOException is thrown. The only thing that looks suspicious to me is the setting "scimUmaClientKeyId" in the Gluu configuration. It was empty by default and I entered the first alias from the _scim-rp.jks_ file. One thing that I observed was, that the path to the jsk I pass to the Java client has no effect at all. I can point to a non-existent file and still get the same IOException. This makes me guess, that the error occurs before the authentication with the server even starts. It seems to be a configuration issue with the Gluu server. But I can't figure out where to search for. Thank you for any further help!