Skip to content

Initiate OAuth Login

POST
/api/v1/oauth/{provider}/initiate
curl --request POST \
--url https://api.spartanauth.com/api/v1/oauth/example/initiate \
--header 'Content-Type: application/json' \
--data '{ "sectorID": "example", "redirectURI": "example" }'

Starts a social login flow for the specified provider and returns the provider authorization URL plus a transactionID used as the OAuth state value. Public endpoint; validates that the provider is enabled for the sector and that any redirectURI is allowed for that sector.

provider
required
string
Media type application/json
object
sectorID
string
redirectURI
string
Example generated
{
"sectorID": "example",
"redirectURI": "example"
}

A successful response.

Media type application/json
object
authURL
string
transactionID
string
Example generated
{
"authURL": "example",
"transactionID": "example"
}

An unexpected error response.

Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}