Skip to content

Change the SAML settings

PUT
/api/settings/sso/saml
curl --request PUT \
--url https://forge.example.com/api/settings/sso/saml \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "metadata": "example", "nextCertificate": "example", "jit": true, "defaultRole": "example", "enabled": true, "version": 1, "groupsAttribute": "example", "secondStepValues": "example" }'

Takes the identity provider’s metadata (XML), a next certificate ahead of a change, and whether newcomers of the organization’s domains are let in. Turning SAML on turns OpenID Connect off, which moves its version on too. Send the settings’ version as you read it, 0 while nothing was saved. A stale one answers 409 with currentVersion, the version it has now. For administrators.

Media typeapplication/json
object
metadata
required
null | string
nextCertificate
required
null | string
jit
required
boolean
defaultRole
required
string
enabled
required
boolean
version
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
groupsAttribute
null | string
secondStepValues
null | string

Example generated

{
"metadata": "example",
"nextCertificate": "example",
"jit": true,
"defaultRole": "example",
"enabled": true,
"version": 1,
"groupsAttribute": "example",
"secondStepValues": "example"
}

OK

Media typeapplication/json
object
configured
required
boolean
idpEntityId
required
null | string
ssoUrl
required
null | string
certificates
required
Array<object>
object
subject
required
string
notAfter
required
string format: date-time
sha256
required
string
jit
required
boolean
defaultRole
required
string
enabled
required
boolean
domains
required
Array<string>
entityId
required
string
acsUrl
required
string
metadataUrl
required
string
groupsAttribute
null | string
secondStepValues
null | string
version
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"configured": true,
"idpEntityId": "example",
"ssoUrl": "example",
"certificates": [
{
"subject": "example",
"notAfter": "2026-04-15T12:00:00Z",
"sha256": "example"
}
],
"jit": true,
"defaultRole": "example",
"enabled": true,
"domains": [
"example"
],
"entityId": "example",
"acsUrl": "example",
"metadataUrl": "example",
"groupsAttribute": "example",
"secondStepValues": "example",
"version": 1
}

A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.

Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}