Available since BellaDati 2.9.18
Process
- Register new app on https://oauth.net/
- Get Client ID and client secret
- Get the User’s Permission
- Authorize the request and get the code from the response
- Exchange the Authorization Code for an Access Token
- Use the access token in the Authorization header to access the resources
Get the User’s Permission
Request Structure
URL |
|
---|---|
Method |
|
Parameters |
|
Example | http://service.belladati.com/auth/oauth/request:new?client_id=8208110359&redirect_uri=http://service.belladati.com/auth&response_type=CODE&state=122342 |
Returns | Opens authorization page
|
Authorize the request
When a user visits this URL, the authorization server will present them with a pop-up asking if they would like to authorize this application’s request.
If the user approves the request, the authorization server will redirect the browser back to the redirect_uri specified by the application, adding a code and state to the query string.
https://service.belladati.com/redirect?code=g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3&state=122342
Exchange the Authorization Code for an Access Token
Request Structure
URL |
|
---|---|
Method |
|
Parameters |
|
Example | http://localhost:8080/oauth/v2/accessToken?grant_type=authorization_code&code=WM0iK6vhik2aUvGmvjiAjl4q3nvWqE3uUcd1Y93V&redirect_uri=http://localhost&client_id=8208110359 |
Returns | JSON with access token
|
Overview
Content Tools