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
/account/authorize works- The client (your app) redirects the user to the
/account/authorize/endpoint with specific query parameters. - The user logs in (if not already) and consents to the requested access.
- 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
| Parameter | Description |
|---|---|
response_type | Determines the type of response expected. Can be only token. |
client_id | The unique identifier for your application. |
redirect_uri | The URL where the user will be redirected after authorization. |
scope | A space-separated list of requested permissions (basic, read, post, conversate, chatbox, market, payment, invoice). |
state | A 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=| Parameter | Description |
|---|---|
client_id | The unique identifier for your application |
user_id | User ID. |
expire_date | Token expiration date. |
scope | Permissions granted by the user. |
issue_date | Unix timestamp of when the token was issued. |
hidden_token | A token not exposed directly to the client. |
token_id | Unique ID for the token. |
access_token | User access token. |
state | The 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 name | Description |
|---|---|
invalid_request | Malformed request. |