Code Monkey home page Code Monkey logo

Comments (16)

jelhub avatar jelhub commented on September 25, 2024

Hi,

Your result:

{
  "Resources": [
	[
	  {
		...
	  },
	  null
	],
	[
	  {
		...
	  },
	  null
	] ==> missing - copy/paste typo?
  ],
  ...
  "schemas": [
	"urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  ...
}

schemas are included, but the Resources array contains array elements and not object elements.

You are using endpointMapper that returns an array having [result, error]

You should change:
let parsedAttr = scimgateway.endpointMapper('inbound', retObj, scimgateway.endpointMap.SecretsSafeUser)
to:
const [parsedAttr, err] = scimgateway.endpointMapper('inbound', retObj, scimgateway.endpointMap.SecretsSafeUser)
if (err) throw err

Regards,
Jarle

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

I ended up using something like the ExploreGroups etc:
for (let index = startIndex - 1; index < obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'].length && (index + 1 - startIndex) < count; ++index) {
const retObj = obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index]
console.log('endpointMapper test : '+scimgateway.endpointMapper('inbound', 'Uri', scimgateway.endpointMap.SecretsSafeUser) )
console.log('endpointMapper test : '+scimgateway.endpointMapper('inbound', retObj, scimgateway.endpointMap.SecretsSafeUser) )

  if (obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].Uri) {
    const scimUser = { // displayName and id is mandatory, note: we set id=displayName
      uniqueid: obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].ID,
      id: obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].Name,
      externalId: obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].RemoteId,
      UserName: obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].Name,
      uri: obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].Uri,
      type: obj['IdentityProviders'][0]['PrincipalTypes'][0]['Users'][index].Type,
	  schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"],
"meta": {"resourceType": "User"}
}
        ret.Resources.push(scimUser) // { id: <id-group>> , displayName: <displayName-group>, members [{value: <id-user>}] }
  }

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

I believe that with the restful example, it is getting the schemas attributes straight from loki db via the gateway. I could be wrong.

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

exploreUsers should return all users.

Using SCIM v2, schemas should be urn:ietf:params:scim:api:messages:2.0:ListResponse and we don't need to include schemas/resourceType on each object like you mention.

Nor do loki/restful plugin, they both returns:

{
  "Resources": [
	{
	  ...
	},
	{
	  ...
	}
  ],
  "totalResults": 2,
  "itemsPerPage": 2,
  "startIndex": 1,
  "schemas": [
	"urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "meta": {
	"resourceType": "User"
  }
}

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

SCIM specification seems not to be clear on this topic.

I have found examples for what I have mentioned, but also found examples for what you have mentioned (schemas defined on each object listed in Resources). If you have verified that SailPoint require on each object, I then need to fix this.

I probably need to fix it anyhow...

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

v3.2.10 have now been published
For SCIM version 2.0 schemas/Resourctype will be included on each object in Resources

Jarle

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

Sorry, did not see your previous update.
Will look into it...

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

What you mentioned in your updated is also fixed in v.3.2.10

Jarle

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

Just try v.3.2.10 without any custom schema/meta logic in your plugin and report back on status.

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

from scimgateway.

jelhub avatar jelhub commented on September 25, 2024

That was good.
Just for curiosity, what other IdP's have you successfully integrated using SCIM Gateway?
I would like to update the validated IdP list.

Thanks,
Jarle

from scimgateway.

mbluteau44 avatar mbluteau44 commented on September 25, 2024

from scimgateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.