Captain-P-Goldfish / SCIM-SDK

a scim implementation as described in RFC7643 and RFC7644
https://github.com/Captain-P-Goldfish/SCIM/wiki
BSD 3-Clause "New" or "Revised" License
121 stars 38 forks source link

response.isSuccess returns false but HTTP Status is 200 #135

Closed jnschbrt closed 3 years ago

jnschbrt commented 3 years ago

Hey! This is likely more a question than a issue..

Im using the ScimClient to retrieve users and groups from an cloud based IDP (Federated Directory) with a bearer token authentication.

However, the isSucess () check returns false, although the HTTP status is 200 and data is returned in the body. I have the same problem with the node.js based scim gateway. Here, however, only with Basic Auth.

Information from the response is printed here:


HEADER: {X-Cloud-Trace-Context=a6129f6f41bc3cae194165aa24bdd7f5, Transfer-Encoding=chunked, Server=Google Frontend, vary=origin,accept-encoding, cache-control=no-cache, Date=Thu, 25 Mar 2021 10:07:55 GMT, Content-Type=application/json; charset=utf-8}

HTTP STATUS: 200

IS SUCCESS: false

BODY: {"totalResults":6,"itemsPerPage":50,"startIndex":1,"schemas":["urn:ietf:params:scim:api:messages:2.0:ListResponse"],"Resources":[{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"id":"a1ec9b70-8d45-11eb-8092-6b8b09f2c982","userName":"armando.pearson@example.com","displayName":"Armando Pearson","photos":[{"type":"photo","primary":true,"value":"https://cdn.federated.directory/images/users/demo/m26.jpg"},{"type":"thumbnail","value":"https://cdn.federated.directory/images/users/demo/thumb/thumb_m26.jpg"}],"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"division":"Getting Started","department":"Bulk"}},{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"id":"8eefc470-8d45-11eb-8092-6b8b09f2c982","userName":"bjensen@example.com","displayName":"Babs Jensen","photos":[{"type":"photo","primary":true,"value":"https://cdn.federated.directory/images/users/demo/w1.jpg"},{"type":"thumbnail","value":"https://cdn.federated.directory/images/users/demo/thumb/thumb_w1.jpg"}],"title":"Tour Guide","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"division":"Getting Started"}},{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"id":"a1ed10a0-8d45-11eb-8092-6b8b09f2c982","userName":"deborah.watson@example.com","displayName":"Deborah Watson","photos":[{"type":"photo","primary":true,"value":"https://cdn.federated.directory/images/users/demo/w18.jpg"},{"type":"thumbnail","value":"https://cdn.federated.directory/images/users/demo/thumb/thumb_w18.jpg"}],"title":"Project Manager","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"division":"Getting Started","department":"Bulk"}},,{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"id":"a1e0dba0-8d45-11eb-8092-6b8b09f2c982","userName":"mae.thomas@example.com","displayName":"Mae Thomas","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"division":"Getting Started","department":"Bulk"}},{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"id":"a1ec2640-8d45-11eb-8092-6b8b09f2c982","userName":"roi.da.rosa@example.com","displayName":"Rói Da Rosa","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"division":"Getting Started","department":"Bulk"}}]}```
Captain-P-Goldfish commented 3 years ago

You'll get the answer if you enable trace-logging:

Unexpected character (',' (code 44)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"{"totalResults":6,"itemsPerPage":50,"startIndex":1,"schemas":["urn:ietf:params:scim:api:messages:2.0:ListResponse"],"Resources":[{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"id":"a1ec9b70-8d45-11eb-8092-6b8b09f2c982","userName":"armando.pearson@example.com","displayName":"Armando Pearson","photos":[{"type":"photo","primary":true,"value":"https://cdn.federated.directory/images/users/demo/m26.jpg"},{"type":"thumbnail","valu"[truncated 2005 chars]; line: 1, column: 1825]