Forums

Forums / Developing Portals / Accessing the security credentials of the current user

Accessing the security credentials of the current user

Thread is closed for posting
2 posts, 1 answered
  1. Bryan Becker
    Bryan Becker avatar
    1 posts
    Registered:
    25 Sep 2018
    15 Jan 2019
    Link to this post
    Hi,

    We are integrating TPC with Experlogix and need to be able to pass the TPC user’s identity and credentials to Experlogix when the user launches it from the portal. Is there a way to access and instance if the current user’s credentials from within TPC.

    Regards,
    Bryan
  2. Josh
    Josh avatar
    47 posts
    Registered:
    01 Jun 2018
    Answered
    29 Oct 2019 in reply to Bryan Becker
    Link to this post

    Hello Bryan,

    It is possible to access various aspects of the user’s identity in The Portal Connector through custom C# code. I will provide examples below on how you can access their Portal Profile, Sitefinity Claim, Sitefinity Profile, and Sitefinity User.

    Portal Profile – Contains Information about the user’s identity in CRM with Entity References including Contact, Customer, ContactPriceList, and User.

    PortalProfile portalProfile = PortalProfile.Current;
    


    Sitefinity Identity (Claims Based Authentication) – User ID, Roles, and Claims Information.

    SitefinityIdentity identity = ClaimsManager.GetCurrentIdentity();
    


    Sitefinity User – Contains a huge amount of information regarding a User.

    UserManager userManager = UserManager.GetManager();
    User user = userManager.GetUser(userId);
    


    Sitefinity Profile – Contains Sitefinity Profile information for a specified User.

    UserProfileManager profileManager = UserProfileManager.GetManager();
    UserManager userManager = UserManager.GetManager();
    User user = userManager.GetUser(userId);
    SitefinityProfile profile = null;
    
    if (user != null)
    {
        profile = profileManager.GetUserProfile<SitefinityProfile>(user);
    }
    


    More information on Sitefinity Users and Profiles can be found here: https://www.progress.com/documentation/sitefinity-cms/for-developers-users

    Hopefully one or more of these identity aspects can provide you with the information you need to send to your external system. In the case that you are unable to acquire all the information you need, it may be advisable to look at implanting Single Sign-On Authentication using an External Identity Provider. More information on that can be found here: https://www.progress.com/blogs/details/single-sign-one-sso-in-sitefinity-with-external-identity-providers

    If you have any other questions please feel free to reply to this thread, or for more complex issues you can email support@crmportalconnector.com.

    Cheers,

    Josh

     

2 posts, 1 answered