Oauth2 Guide

Authorization in third party apps

The /account/authorize endpoint in OAuth2 is used to initiate the authorization process, allowing users to grant third-party applications access to their resources securely.


How /account/authorize works

  1. The client (your app) redirects the user to the /account/authorize/ endpoint with specific query parameters.
  2. The user logs in (if not already) and consents to the requested access.
  3. The authorization server redirects the user back to the client with an access token.

Example Authorization Url

https://lzt.market/account/authorize?client_id=5ggftt92ww&response_type=token&scope=read%20post
https://lolz.live/account/authorize?client_id=5ggftt92ww&response_type=token&scope=read+post&redirect_uri=https://lolzteam.readme.io/reference/oauth2

Query Parameters

ParameterDescription
response_typeDetermines the type of response expected. Can be only token.
client_idThe unique identifier for your application.
redirect_uriThe URL where the user will be redirected after authorization.
scopeA space-separated list of requested permissions (basic, read, post, conversate, chatbox, market, payment, invoice).
stateA random string to prevent CSRF attacks and track the client session.

Server Responses

Successful Authorization

If the user approves, they are redirected to the redirect_uri with an access token:

https://example.url/callback#client_id=client_id&user_id=0&expire_date=0&scope=post+read&issue_date=0&hidden_token=0&token_id=0&access_token=jwt_token&state=
ParameterDescription
client_idThe unique identifier for your application
user_idUser ID.
expire_dateToken expiration date.
scopePermissions granted by the user.
issue_dateUnix timestamp of when the token was issued.
hidden_tokenA token not exposed directly to the client.
token_idUnique ID for the token.
access_tokenUser access token.
stateThe same value sent in the request, used to validate the response.

Error Response

If the user denies access or an error occurs:

https://example.url/callback?error=invalid_request&error_description=Invalid+or+missing+response+type&state=
Error nameDescription
invalid_requestMalformed request.