In OAuth2 terms, scopes are a set of permissions which require user consent.
You've probably seen logins like Google that warn you about the data the third-party application is requesting and give you the option to accept or refuse the request.
Consider the following specs in designing your scopes endpoint:
URL | anything |
Method | POST |
Headers | Content-Type, Signature |
Format | JSON |
Attribute | Type | Required | Default |
---|---|---|---|
lang | string | Yes | en |
Code | Description |
---|---|
200 | Success |
400 | Signature/Input validation Failed |
The response should be a json array containing a list of scopes with the following structure:
[
{
"id": "*",
"title": "Read and Write all data.",
"icon": "fa-user-shield",
"description": null,
"url": null
},
{
"id": "profile",
"title": "Access to information like name, birthday and gender.",
"icon": "fa-user-shield",
"description": null,
"url": null
},
...
]
For a deeper understanding of the structure and optional properties, refer to the schema.