Implicit Grant

The implicit grant is useful when you don't have a server to work with, eg. if you're building a single page application. This flow generates shorter-life tokens and does not generate refresh tokens. Read more about the Implicit Grant.

Summary of steps:
  1. User clicks a link on your site (for example "Connect to LionDesk") to initiate the authorization flow.
  2. User is taken to an "OAuth Dialog" and asked to approve your application
  3. After approving your application the page redirects to the Redirect URI of your application and includes the access token in the URI fragment ie. "#access_token=b2374c372054e43c8da7c5ed681d8de880ee9762"

1. Display an Authorization Link

Create a link to https://api-v2.liondesk.com//oauth2/authorize with the following query parameters:

ParameterValueDescription
response_typetoken
client_id[your Client ID]
redirect_uri[your Redirect URI]
scope[requested scopes]space-delimited string. eg. "write"

Example:<a href="https://api-v2.liondesk.com//oauth2/authorize?response_type=token&client_id=liondesk&scope=write&redirect_uri=https://myapp.co/liondesk/callback">Connect with LionDesk</a>

Your users can click this link to start the authorization flow.

2. Extract the Access Token

If the user approves your request they will be redirected to your Redirect URI with an access token in the URI fragment, eg.

https://myapp.co/liondesk/callback#access_token=b2374c372054e43c8da7c5ed681d8de880ee9762&expires=2018-02-11T23%3A46%3A27.000Z&expires_in=2592000&scope=write&token_type=Bearer

You can extract the access_token from the URI fragment with Javascript.

4. Use the Token!

Congrats you now have an access token to use to make requests on behalf of the user.