Forum Discussion

gamiller's avatar
8 years ago
Solved

Generate session key from endpoint with SSO configured

Is there any way to generate a session key using login & password if we already have SSO configured for our community? We're hoping to condense a series of API requests from one of our applications using an endpoint, but we can't figure out the session_key logic, and I'm thinking it's not working because we have SSO configured for our community. 

Alternatively, is there any way to execute a Rest request without a user being logged in?

5 Replies

  • DougS's avatar
    DougS
    Khoros Oracle
    8 years ago

    This article explains how you can generate a REST API session token using an SSO token:

     

    Using the REST API with SSO credentials

     

    You can pass the token that is generated via that call to any endpoint call you make to execute the endpoint as that user.

     

    -Doug

  • ChiaraS's avatar
    ChiaraS
    Lithium Alumni (Retired)
    8 years ago

    gamiller even if the community has SSO, you can still create a non-SSO user via the Community Admin and do an API authentication providing username and password: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=sessionauth

    As said above, you can then pass the session_key to the endpoint (as restapi.session_key parameter) and all the calls done in the endpoint with the "rest" FreeMarker object will be executed as that specific user.

  • gamiller's avatar
    gamiller
    Adept
    8 years ago

    We're hoping to not have to use the LithiumSSOClient class. I'm looking for a solution that explicitly doesn't use SSO auth whatsoever.

  • ChiaraS's avatar
    ChiaraS
    Lithium Alumni (Retired)
    8 years ago

    gamiller the solution above with the creation of a non-SSO user doesn't need any SSO auth...

  • gamiller's avatar
    gamiller
    Adept
    8 years ago

    Oh, you're right! Opened the wrong tab. Yeah this looks like it should work. Thanks!