Completar callback OAuth pelo frontend
curl --request POST \
--url https://api-bc.pgubright.com/auth/complete-callback \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"state": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', state: '<string>'})
};
fetch('https://api-bc.pgubright.com/auth/complete-callback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/auth/complete-callback"
payload = {
"code": "<string>",
"state": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"access_token": "<string>",
"expires_in": 123,
"refresh_expires_in": 123,
"refresh_token": "<string>",
"token_type": "Bearer",
"scope": "<string>"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Autenticação
Completar callback OAuth pelo frontend
POST
/
auth
/
complete-callback
Completar callback OAuth pelo frontend
curl --request POST \
--url https://api-bc.pgubright.com/auth/complete-callback \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"state": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', state: '<string>'})
};
fetch('https://api-bc.pgubright.com/auth/complete-callback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/auth/complete-callback"
payload = {
"code": "<string>",
"state": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"access_token": "<string>",
"expires_in": 123,
"refresh_expires_in": 123,
"refresh_token": "<string>",
"token_type": "Bearer",
"scope": "<string>"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}