OAuth login
Introduction
The purpose of this guide is to show how to login through OAuth provider using API. If you need to connect your application with Circularo login and your organization is using an OAuth provider, this guide should help you with the setup.
Step 1 - Call provider endpoint
This step will connect you with the service provider that you specify. In other words if you select a Google it will redirect you to a window asking to login with your Google account.
Endpoint
GET /oauth/:strategy_name
Request
GET /oauth/google?callback=localhost%3A8080%2Flogin&domain=https%3A%2F%2Ftest.circularo.com%2F
The callback URL needs to be allowed in the Circularo settings. Our support team will help you with that.
We are redirected to Google Auth:
After successful authentication with the provider the application redirects back to your callback URL with query parameter code
like this:
localhost:8080/login?code=19448c3c-040d-4fa6-a0cf-2dec800aab3c
Step 2 - Use the code to generate login token
Use the code from previous step to receive a token that you can use for login.
Endpoint
GET /oauth/code/:code
Request
GET /oauth/code/19448c3c-040d-4fa6-a0cf-2dec800aab3c
Response
{
"token": "DY8MZ6tt7zpDGFXZjewWY24DnGpc0jWFB6XxaGloLabzLC8Etqnawo0cWsRPcHxs"
}