is there an alternate way of populating IUser object without using core.GetUser() method which hits the mendix db?

0
hi team, we are trying to work on a POC wherein we are connecting to a proprietary opened connect provider and trying to authenticate / authorize users. core.InitializeSession() method takes IUser object as input but there's no other way apart from core.getuser() to populate the data. We cannot use core.getUser() method as we don't store user details in mendix db and we store it in a separate container. So, is there an alternate way to populate user details into IUser object and then initialize session??....
asked
3 answers
1

Hello Darshan,

Don't think you can initialise the session for a user that doesn't exist in the Mendix DB. 

I think you'll have to create a user if one doesn't exist and store the existing users in the Mendix DB if you want your Auth to be driven by an external service.

Hope this helps.

answered
1

Hi,

just guessing here: did you set User.Name and User.Password? Both are required.

btw. proxies.User.commit is just a wrapper for the Core.commit function.

regards, Fabian

answered
0

See my answer in this forum post: https://forum.mendix.com/link/questions/91802

This way you create in Mendix a webservice. The identity provider can call this webservice to create the login token and then can redirect that user to a deeplink URL. Deeplink module checks the token and logs the user in.

Saves the trouble of creating custom Java. Only some small Javascript needed for the user login but the blogpost gives very good sample on how all works.

Regards,

Ronald

answered