Skip to content

Set OAuth Providers

PUT
/api/v1/sectors/{sectorID}/oauth/providers
curl --request PUT \
--url https://api.spartanauth.com/api/v1/sectors/example/oauth/providers \
--header 'Content-Type: application/json' \
--data '{ "providers": { "additionalProperty": { "enabled": true, "clientID": "example", "clientSecret": "example", "teamID": "example", "keyID": "example", "privateKeyPEM": "example", "redirectURI": "example", "issuerURL": "example", "appID": "example" } } }'

Creates or updates the OAuth provider configuration for a sector. Requires a valid bearer token and sector-admin or default-sector-admin access; empty secret fields preserve the currently stored secret values.

sectorID
required
string
Media type application/json
object
providers
object
key
additional properties

OAuthProviderAdminConfig carries the full credentials when an admin configures a provider. Empty-string secret fields mean “keep the existing value” (patch semantics).

object
enabled
boolean
clientID
string
clientSecret
Google / GitHub OAuth App; empty = keep existing
string
teamID
Apple
string
keyID
Apple
string
privateKeyPEM
Apple ES256 or GitHub App RSA key PEM; empty = keep existing
string
redirectURI
string
issuerURL

IssuerURL is required for the generic “oidc” provider (discovery document base URL).

string
appID

AppID is the GitHub App ID (numeric string). When set, SpartanAuth uses an RS256 JWT signed with privateKeyPEM to authenticate as the GitHub App during token exchange, instead of a static clientSecret.

string
Example generated
{
"providers": {
"additionalProperty": {
"enabled": true,
"clientID": "example",
"clientSecret": "example",
"teamID": "example",
"keyID": "example",
"privateKeyPEM": "example",
"redirectURI": "example",
"issuerURL": "example",
"appID": "example"
}
}
}

A successful response.

Media type application/json
object
status
string
message
string
Example generated
{
"status": "example",
"message": "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"
}
]
}