Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread HugoCerdeira
Thats not a problem because i authenticate on syncope via username/password i only need the email for the webservice that i sue on the groovy script, so it works as it is! Thanks anyway. Cheers, Hugo Cerdeira. -- Sent from: http://syncope-user.1051894.n5.nabble.com/

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread HugoCerdeira
After i few tries, and with all your help i think i got it. The external key always come to the script via the "username" variable, since its, probably, the way the connector is written, if i map the email as external id, i can access the email field of the user from the groovy script via the

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread Andrea Patricelli
Ok now I got. You do not need to read Syncope mapping, or anything by Syncope, but options and objectClass. You only have to return the value of the email attribute read from the REST WS response. The name of the external attribute you should already know, it is static, because is the one

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread HugoCerdeira
Thanks once again for the quick reply, Setting the mapping as bidirectional, did not work. Using the command "this.binding.variables.each {k,v -> map[k]=v}" on my groovy script, to check what it actually has I get the following map: [password:authPassword,

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread Andrea Patricelli
Il 28/02/2018 13:08, HugoCerdeira ha scritto: Hi, Thanks for your quick answers, After mapping the email on the resource, I cant access it on the groovyscript. This is my mapping: If I use the

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread HugoCerdeira
Hi, Thanks for your quick answers, After mapping the email on the resource, I cant access it on the groovyscript. This is my mapping: If I use the external_email on the groovyscript, my script just

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread Andrea Patricelli
Il 28/02/2018 11:31, HugoCerdeira ha scritto: Hi, Well that helps, but what if I need to get the user email in order to make the external authentication work? its seems like I cant access the email, even if I map it on the resource. Use email as remote key and add mapping on Syncope: email ->

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread HugoCerdeira
Hi, Well that helps, but what if I need to get the user email in order to make the external authentication work? its seems like I cant access the email, even if I map it on the resource. Thanks for your help, Hugo Cerdeira. -- Sent from: http://syncope-user.1051894.n5.nabble.com/

Re: How to make sql queries on a authentication groovy script

2018-02-28 Thread Andrea Patricelli
Good morning, Il 27/02/2018 17:59, HugoCerdeira ha scritto: Hi, I'm making an authentication groovy script my goal is the following flow: 1. Script makes a request to a service sending the user and password. 2. If the request response is successful query the syncope db for the user id, using