Oauth2

Guide to OAuth2 /account/authorize Endpoint

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 /account/authorize 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%20post

Query Parameters

ParameterDescription
response_typeDetermines the type of response expected. Currently 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, market).
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 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. (Currently it's 1 year since token was issued)
scopePermissions granted by the user.
issue_dateDate and time the token was issued.
hidden_tokenA token not exposed directly to the client.
token_idUnique id for the token.
access_tokenUser 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.