Forum Discussion

nickz's avatar
nickz
Guide
10 years ago

How to pass parameters to Lithium when doing SSO

We use Lithium SSO in our product and invoke LithiumSSOClient.writeLithiumCookie() to write the SSO Cookie. We pass some parameters to Lihtium when calling this method.


It's something like:
Map<String, String> chatParms = new HashMap<String, String>();
chatParms.put("profile.businessname", busName);
chatParms.put("profile.businessid", "" + busId);
chatParms.put("roles.grant", "DF_SSO_Role");
LithiumSSOClient.writeLithiumCookie(ssoId, login, loginUser.getEmail(), chatParms, request, response);

 

The customers of our product are business owners. Their businesses belong to different industries, such as dental, spa, vet...

 

Now we want to pass the industry parameter to lithium when writing SSO Cookie.

 

1. How can I pass the industry value to Lithium? Can I use chatParms.put("profile.industry", industry)?

 

2. If the parameter is passed to Lithium successfully, how can I get/use the value in community website? We want to show users the topics related to their industries.

 

3. We also use Lithium REST API in our product. Users can search for articles by using the URL like "http://community.ourwebsite.com/ourwebsite/restapi/vc/categories/id/ourwebsite-tkb/search/messages?q=email&restapi.response_style=view&restapi.format_detail=full_list_element".

We also want to get the results that are industry sensitive. Where should I add the industry parameter to the URL?

 

Thanks.

 

  • JakeS's avatar
    JakeS
    Lithium Alumni (Retired)
    I believe that you should be able to pass that param in as long as it is defined as a custom profile field; then you should be able to retrieve it for any user. Probably this has already been done for fields like profile.businessname since I don't think those are out of the box profile fields.

    For the other part of what you're trying to do, find relevant messages based on industry, I would recommend using custom tags (you should normalize the industry names not to contain whitespace if you use this approach). Then you should be able to make an API call for messages with that tag applied.

    This should all be documented, or else services can help with things like custom profile fields. Let me know if you need help finding any documentation.
    • RIMSUNDEVIL11's avatar
      RIMSUNDEVIL11
      Contributor

      How would you pass multiple roles in this case?

      For example, code above has:

      chatParms.put("roles.grant", "DF_SSO_Role");

       

      what if you want to add a second role called DF_SSO_Role2?

       

       

      • PaoloT's avatar
        PaoloT
        Lithium Alumni (Retired)

        RIMSUNDEVIL11 

         

        I believe you can pass a comma delimited string (with multiple roles) as well for roles.grant and roles.revoke