Initiate OAuth Login
POST
/api/v1/oauth/{provider}/initiate
const url = 'https://api.spartanauth.com/api/v1/oauth/example/initiate';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"sectorID":"example","redirectURI":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” provider
required
string
Request Body
Section titled “Request Body ” Media type application/json
object
sectorID
string
redirectURI
string
Example generated
{ "sectorID": "example", "redirectURI": "example"}Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
authURL
string
transactionID
string
Example generated
{ "authURL": "example", "transactionID": "example"}default
Section titled “default ”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" } ]}