Forum Discussion

Inactive User's avatar
Inactive User
13 years ago

Accessing attributes passed via SSO

Is there a way to access the attributes that we pass in via SSO? 

I know if you login to Lithium as an admin, you can view the SSO id on a user's profile page so I assume there is a way to reference it somehow...

A code snippet would be extremely helpful.

 

Thanks

3 Replies

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago

    Hey jlutterloh,

     

    You can get the user object using the rest API. The user object contains the sso_id. The code below will create a component that outputs the SSO ID for current user if the current user has an sso id. The check in the if checks if the user has an sso_id.

     

    <#assign user_obj = rest("/users/id/" + user.id)>
    <#if user_obj.user.sso_id[0]??>
    ${user_obj.user.sso_id}
    </#if>
    

     

    You can see the type of information you can get from the user object by just calling the restapi url:

     

    {communityurl}/restapi/vc/users/id/{user.id}

     

    Hope this helps,

     

    Yuri

  • Inactive User's avatar
    Inactive User
    12 years ago

    Sweet. I'll give it a shot. Thanks!

  • KaelaC's avatar
    KaelaC
    Lithium Alumni (Retired)
    12 years ago

    Hey jlutterloh -

     

    What kind of info are you wanting to access?  If it is profile fileds passed thorugh sso, you can access them with a user profile rest call.  Any profile field passed through sso is immediately updated on the user profle when they log in.

     

    /restapi/vc/users/id/[user id]/profiles/name/[profile name]