You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Alex123 <my...@gmail.com> on 2018/03/22 15:41:41 UTC
How to use different remote keys for single syncope user with
multiple REST connectors
Hi!
As an instance I have 3 REST connectors.
I create user 'Test@test.com' in syncope. He has syncope key
'asdfsdaf-asddfasdf-asdfasdf-asdfasdf'. During creation flow I add 3 rest
connectors to this user.
When Syncope pull user to each REST connector all of them by default create
different ids for this use:
A first connector creates user 'Test@test.com' with id = 1
Second connector creates user 'Test@test.com' with id = 'TE45HDS'
Third connector creates user 'Test@test.com' with id =
'ghkjghkj-ghkghkj-ghkjghkj-ghkjghk'
1) Is it possible to define different remote keys for one Syncope user for
multiple connectors
Remote key could not be null. But when I create a user in syncope I will get
valid remote keys from all connectors only after CREATE operation.
2) Is it possible to disable Remote key validation? (For now I just set
random values during user creation flow in Syncope)
3) Is it possible to update remote key in CREATE groovy script for each
connector?
Thank you in advance for your help.
--
Sent from: http://syncope-user.1051894.n5.nabble.com/
Re: How to use different remote keys for single syncope user with
multiple REST connectors
Posted by Andrea Patricelli <an...@apache.org>.
Hi Alex,
Il 22/03/2018 16:41, Alex123 ha scritto:
> Hi!
> As an instance I have 3 REST connectors.
> I create user 'Test@test.com' in syncope. He has syncope key
> 'asdfsdaf-asddfasdf-asdfasdf-asdfasdf'. During creation flow I add 3 rest
> connectors to this user.
>
> When Syncope pull user to each REST connector all of them by default create
> different ids for this use:
> A first connector creates user 'Test@test.com' with id = 1
> Second connector creates user 'Test@test.com' with id = 'TE45HDS'
> Third connector creates user 'Test@test.com' with id =
> 'ghkjghkj-ghkghkj-ghkjghkj-ghkjghk'
>
> 1) Is it possible to define different remote keys for one Syncope user for
> multiple connectors
>
> Remote key could not be null. But when I create a user in syncope I will get
> valid remote keys from all connectors only after CREATE operation.
Yes, sure. You can do it through resource provisioning rules, especially
mapping. With resource I mean the external resource created from the
connector. Please take a look at [1].
For example you could define a mapping between an custom attribute on
Syncope and the key on the resource: e.g. someConnectorKey (syncope) ->
remoteId (external resource).
A best practice is to add this mapping someConnectorKey (Internal
attribute) -> __UID__ (External attribute).
Thus you'll have two keys: the key on syncope and someConnectorKey
(custom plain schema) mapped with the remote key on the resource.
Moreover you should flag someConnectorKey mapping as "Remote Key"
In order to populate such key attribute (that is the key on the
connector) just after creation, you should define a custom propagation
actions class and implement a logic to populate the attribute "manually"
with data coming back from the resource. Take a look at [2], [3] and [4].
>
> 2) Is it possible to disable Remote key validation? (For now I just set
> random values during user creation flow in Syncope)
What kind of validation are you referring to? If you add the mapping
above mentioned you an use whatever string as key.
> 3) Is it possible to update remote key in CREATE groovy script for each
> connector?
Yes you can do it by updating the attribute mapped as remote key. For
example __UID__ on groovy script, or the external attribute mapped as key.
> Thank you in advance for your help.
HTH,
Andrea
>
> --
> Sent from: http://syncope-user.1051894.n5.nabble.com/
[1]
https://syncope.apache.org/docs/reference-guide.html#external-resource-details
[2] https://syncope.apache.org/docs/reference-guide.html#propagationactions
[3]
https://github.com/apache/syncope/blob/syncope-2.0.8/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/GoogleAppsPropagationActions.java
[4]
https://github.com/apache/syncope/blob/2_0_X/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AzurePropagationActions.java
--
Dott. Andrea Patricelli
Tel. +39 3204524292
Developer @ Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net
Apache Syncope PMC Member