0 Replies Latest reply on Jan 2, 2018 9:49 PM by jacekgra RSS
    jacekgra Apprentice

    Custom Authenticator - get User object in order to set User Extenstions properties

    Hi, I am working on custom authenticator and I would like to store some auth key (from external system) in given user extension property directly in Authenticator code.


    In normal service I can use following code:


    User user = (User) EntityUtilities.findEntity("Jacek", RelationshipTypes.ThingworxRelationshipTypes.User);
    user.setPropertyValue("lastName", new StringPrimitive("Gralak"));

    And this works great. However when I am using the same piece of code after fire of successful login event in authenticator User object is null (EntityUtiilites are not able to retrieve user object):




    User user = (User) EntityUtilities.findEntity(USERNAME, RelationshipTypes.ThingworxRelationshipTypes.User);
    user.setPropertyValue("lastName", new StringPrimitive("authentiocator"));


    Here user object is null.

    Any hints?