Hello Martin, Thank you very much for sharing it. I'll have a look to undestand it and adapt it to my needs.
Best regards, Juan On Wed, Mar 13, 2019 at 10:02 AM Martin Bohun <[email protected]> wrote: > Hi Juan, > > We (ALA) are doing exactly that with a custom AuthenticationHandler: > > https://github.com/AtlasOfLivingAustralia/ala-cas-2.0/blob/master/src/main/java/org/jasig/cas/support/pac4j/authentication/handler/support/ALAClientAuthenticationHandler.java#L99 > > Basically one of the "social media" OAuth1.0, OAuth2.0, OICD, SAML, etc. > does the authentication and returns an email_address, first_name, surname, > I take the email and check if it already exists in our user DB, if yes, i > just SignIn the user, if the user does not exist I create the user in the > DB (SignUp) and then SignIn > > We had originally only username/password login (the user credentials are > stored in mysql DB) so I simply reused all the existing DB beans, > properties (like the SQL query to get the user with user attributes etc), > the only addition was the authentication with "social media", and getting > the email address, from there on it connected to the existing > username/password login scenario. > > kind regards, > > martin > > On Wednesday, March 13, 2019 at 7:32:48 PM UTC+11, Juan David Sánchez > wrote: >> >> Hi, >> >> >> I’m using Cas with OpenId Connect support. The authentication is >> deletaged to Azure Active Directory but I also have a user database (which >> regularly pulls users from the active directory) from which I would like to >> retrieve some user attributes after a sucessfull login in Azure. >> >> >> I would like to extract the unique_name, which I’m getting from Azure, >> and then fetch a user from database whose email matches that unique_name, >> and finally return to the application releasing the user attributes fetched >> from database. >> >> >> Before throwing myself into a custom development, I would like to ask to >> the community if there is built-in way in which I could achive this. >> >> >> Thank you for the support >> > -- > - Website: https://apereo.github.io/cas > - Gitter Chatroom: https://gitter.im/apereo/cas > - List Guidelines: https://goo.gl/1VRrw7 > - Contributions: https://goo.gl/mh7qDG > --- > You received this message because you are subscribed to the Google Groups > "CAS Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/a/apereo.org/d/msgid/cas-user/5e1dd9bd-9286-42b0-a71b-884b9ef06b12%40apereo.org > <https://groups.google.com/a/apereo.org/d/msgid/cas-user/5e1dd9bd-9286-42b0-a71b-884b9ef06b12%40apereo.org?utm_medium=email&utm_source=footer> > . > -- - Website: https://apereo.github.io/cas - Gitter Chatroom: https://gitter.im/apereo/cas - List Guidelines: https://goo.gl/1VRrw7 - Contributions: https://goo.gl/mh7qDG --- You received this message because you are subscribed to the Google Groups "CAS Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CADtce6PUnVSqW-%2BdtfkZ_by4%3DFasic%3Dac6eQFjAsC92mK9m5Nw%40mail.gmail.com.
