Oauth 2.0: openid connect customization...issue with populating system.user with my custom user...currentuser() still showing up the old anonymous user details...

hi team, we are currently working on a POC wherein we are trying to use an in-house developed openid connect provider to authenticate / authorize users. We are able to do it with the help of the oauth 2.0 module. However, we are still not able to populate this user details into the system.user() entity and the currentUser() still returns some anonymous user details.  From the java side, we are however able to commit the system.user data but not able to set it up as an active session / active user. Any idea / help would be appreciated here ??  
1 answers

You should be able to create a session for a newly created user and redirect your anonymous user to your homepage with the right cookies for your newly created user to kick in.

Something like what I have below:

ISession session  = Core.initializeSession(user, null);

response.addCookie(XAS_SESSION_ID, session.getId().toString(), "/", "", -1);
response.addCookie(XAS_ID, "0." + Core.getXASId(), "/", "", -1);
response.addCookie(OriginURI, OriginURIValue, "/", "", SECONDS_PER_YEAR);

response.addHeader("location", indexpage);


If you're using the OAuth 2.0 module, it already has this in it.