Request an Authorization Code

To request an authorization code, you must direct the user's browser to the talque OAuth 2.0 authorization endpoint. Once the request is made, one of the following two situations will occur:

  • If the user has not previously accepted the application's permission request, or the grant has expired or been manually revoked by the user, the browser will be redirected to the talque authorization screen. When the user completes the authorization process, the browser is redirected to the URL provided in the redirect_uri query parameter.

  • If there is a valid existing permission grant from the user, the authorization screen is by-passed and the user is immediately redirected to the URL provided in the redirect_uri query parameter.

Note that if you ever change the scope permissions that your application requires, your users will have to re-authenticate to ensure that they have explicitly granted your application all of the permissions that it requests on their behalf.

Request Authorization Code

GET https://www.talque.com/oauth2/authorization

Redirect the browser to this URL to request an authorization code

Query Parameters

Name
Type
Description

scope

string

Space-separated list of scope values (note that the space must be URL encoded)

response_type

string

Should always be "code"

client_id

string

Your API client ID

redirect_url

string

One of the redirect urls configured for your application.

state

string

A unique string of your choice that cannot be guessed. To protect against CSRF.

If the user approves the OAuth2 request, the browser is redirect to the callback URL defined in your redirect_uri parameter. Added to the redirect_uri will be two important URL query parameters:

  • code: the OAuth 2.0 authorization code.

  • state: A value used to protect against possible CSRF attacks.

First of all, you must compare the returned state with the state that you passed in. Any difference indicates a CSRF attack and you should throw an HTTP 401 error code.

The code is a value that you will exchange with talque for the actual OAuth 2.0 access token in the next step of the authentication process. For security reasons, the authorization code has a very short lifespan and must be used within moments of receiving it.

The authorization code (as well as the access code in the next step) are relatively long strings. Your code should allow for at least 1000 characters.

Available scopes

The following elementary scopes are available in talque:

  • EMAIL: This scope allows read access to the user's primary email address

  • PROFILE: This scope allows read access to the user's public profile information. This includes

    • First and last name

    • Company name

    • Job title

    • Profile photo

    • Account registration date

Last updated