Forum Discussion

rdaviscc's avatar
rdaviscc
Helper
13 years ago

Authentication issues

Hey All,

 

I am having an issue when it comes to authentication.  I am trying to pass in credentials through a query post like it mentions in the documentation.  I am doing all of this with a REST client from here. I have tried passing it in with the parameters and I have tried as basic authentication with no luck. I am working from within a stage environment and I am trying to access the metrics of a board between certain times. 

 

Can anyone offer any assistance as I am currently stuck on the authentication.

  • AdamN's avatar
    AdamN
    13 years ago

    You're right, to create a Lithium Registration account in production, the best approach would be to have our support team create it there. I proposed the alternative for stage because it's likely quicker and easier.

     

    Lithium SSO tokens are not generated by the communication application. There is a separate Lithium SSO library that your company would have installed on their servers to generate these SSO tokens. You would need to obtain the SSO token for your account via that Library.

     

    Once you've authenticated and obtained the session key, you can pass it to subsequent requests via the restapi.session_key query string parameter. See the index page of the JavaDocs for additional information on REST API session keys.

9 Replies

  • What's the error you see and what's the REST call you are making to authenticate?
    Also: Does your community use SSO or is it plain Lithium users?
  • I am getting a 302: failed to authenticate error. Yes it is using SSO.
  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    Are you authenticating as a regular user or as an admin user? If you've been testing as an admin user, see what happens with a regular user account.

     

    Our application performs some additional security checks with admin accounts to ensure that the IP address in the SSO token matches the IP address of the user attempting to use that token. It sounds like your request might be failing that test. Testing with a regular account vs admin user will help confirm.

  • rdaviscc's avatar
    rdaviscc
    Helper
    13 years ago
    Hey,

    So I think I am having a disconnect as I have read everything I could about authenticating. Will I have to use SSO to authenticate in order to pull metric information about a board. In the documentation it appears that I can do a query the sessions/login?user.login=username&user.password=password but i get a 302 everytime.

    If i do have to use SSO, I assume that I need the key that Lithium gave us. Is this anywhere in the product itself?

    I appreciate the help as I am working with minimal time.

    -Ryan
  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    Ah, apologies for the confusion... When you said you were using SSO, I must have assumed you meant that you were authenticating to the REST API using an SSO token.

     

    The account you're testing with, was it created directly in the community, or was it created via SSO? If it was created via SSO, then it would not have a password on the Lithium side since that is stored in your company's database. The only way to authenticate directly to an SSO account via REST API is to use an SSO token generated via the Lithium SSO library that your company has installed. To authenticate to the REST API with a username and password, you'll need to use an account that was created via normal Lithium Registration. 

     

    If you don't already have a Lithium Registration account in stage, you can do one of two things:

    1. Temporarily disable SSO on stage via the admin and create an account via the normal registration process
    2. File a case in our customer support portal, and our support team should be able to assist with creating an account for you
  • rdaviscc's avatar
    rdaviscc
    Helper
    13 years ago
    The account I created was created using the SSO as the community member was created through our portal. Now I can do what your saying for staged I presume but not so much for our production.

    So i think at this point it may be best to get my SSO key. Is there any easier way to get this from with in the product itself?

    Also, is there any default registration path where I could bypass SSO with out disabling it?
  • rdaviscc's avatar
    rdaviscc
    Helper
    13 years ago

    Ok, I got a way to get around the SSO. Now i need to dig deeper. Can you please give me an example of how to pull metrics from the boards. I have read the documentation but I want to see how this Session Key is passed in to retrieve that exclusive data.  

     

    I know your documentation 

    The query parameter method requires the user to log in using the REST API call 
    /authentication/sessions/login, which returns a session key. You then pass this 
    session key in subsequent requests to identify the user making the request.

     Do i pass these in through the headers and if so what does it look like?

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    You're right, to create a Lithium Registration account in production, the best approach would be to have our support team create it there. I proposed the alternative for stage because it's likely quicker and easier.

     

    Lithium SSO tokens are not generated by the communication application. There is a separate Lithium SSO library that your company would have installed on their servers to generate these SSO tokens. You would need to obtain the SSO token for your account via that Library.

     

    Once you've authenticated and obtained the session key, you can pass it to subsequent requests via the restapi.session_key query string parameter. See the index page of the JavaDocs for additional information on REST API session keys.

  • rdaviscc's avatar
    rdaviscc
    Helper
    13 years ago
    Awesome, that gets me to where I need to be. Thank you for your help.