Set OAuth Providers
PUT
/api/v1/sectors/{sectorID}/oauth/providers
const url = 'https://api.spartanauth.com/api/v1/sectors/example/oauth/providers';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"providers":{"additionalProperty":{"enabled":true,"clientID":"example","clientSecret":"example","teamID":"example","keyID":"example","privateKeyPEM":"example","redirectURI":"example","issuerURL":"example","appID":"example"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” sectorID
required
string
Request Body
Section titled “Request Body ” 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" } }}Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
status
string
message
string
Example generated
{ "status": "example", "message": "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" } ]}