curl --request POST \
--url https://api.example.com/auth/oauth/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"redirectUri": "<string>",
"state": "<string>"
}
'{
"authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth?...",
"state": "abc123"
}
Gerar uma URL de autorizacao OAuth para Google ou Microsoft para iniciar o fluxo de sign-in.
curl --request POST \
--url https://api.example.com/auth/oauth/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"redirectUri": "<string>",
"state": "<string>"
}
'{
"authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth?...",
"state": "abc123"
}
curl -X POST https://api.awsales.io/studio/auth/oauth/authorize \
-H "Content-Type: application/json" \
-d '{
"provider": "GoogleOAuth",
"redirectUri": "https://app.example.com/auth/callback",
"state": "random-csrf-token"
}'
Solicite a URL de autorizacao
authorizationUrl.Redirecione o usuario
authorizationUrl. Ele se autenticara com o provedor OAuth (Google ou Microsoft).Trate o callback
redirectUri com um parametro code. Envie este codigo para o endpoint OAuth Callback para completar a autenticacao.GoogleOAuth, MicrosoftOAuth.{
"authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth?...",
"state": "abc123"
}
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
500 | internal_server_error | Ocorreu um erro inesperado |