Forum Discussion

Hari329's avatar
Hari329
Adept
10 years ago

Using the authorization grant flow via a back-end API call

Hi ,

 

We are planning to use " authorization grant flow  via a back-end API call ". Could you please let me know the process to get the access token and refresh token after we create API-only user with appropriate permissions ?

 

This is to pull data from lithium community sites and display on some of our other sites. 

 

An earliest response will help a lot !

 

Thanks,

Hari

 

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)

    Hi Hari329

     

    the "Authorization Grant" flow is interactive and therefore not suitable for a server to server integration. You could of corse log in manually with the "API user" via the browser and obtain an access and refresh token, and then use these directly, but I don't think this would be suitable for a back-end integration.

     

    What I suggest for the time being is to see whether you can use rest V1 in that scenario, for the time being.

     

    Thanks,

    • PaoloT's avatar
      PaoloT
      Lithium Alumni (Retired)

      To clarify my above response, you could also approach this by coding an administrative interface which allows an authorized admin user to link your application via the interactive flow (using the api only account) and then persists the tokens that will be used for the subsequent calls. This would also allow to refresh the tokens if they become invalid and for some reason it's not possible to get a new one via a refresh token etc...

      • Hari329's avatar
        Hari329
        Adept

        Hi Paolo Tagliaferri,

        Thanks for the information. Below are the steps we planned :

        1.Create API user
        2.Log in manually with the "API user" to our lithium communities site and obtain an access and refresh token. Could you please help me to understand the steps involved in obtaining access and refresh key after log in ?
        3.Once we get the access and refresh key with manual log in process , we are planning to store it in our system to use whenever we are calling lithium communities using REST API to get the data

        Do you see any issues with above process ?

        And also could you please elaborate on administrative interface process you mentioned below ?

        Thanks a lot for your support,
        Hari