Save the authentication policy
PUT
/v1/setup/auth-policy
const url = 'http://localhost:8080/v1/setup/auth-policy';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"accessTokenMinutes":1,"refreshTokenHours":1,"otpTtlMinutes":1,"passwordMinLength":1,"passwordLoginEnabled":true,"otpLoginEnabled":true,"allowedEmailDomains":["example"],"publicUrl":"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 http://localhost:8080/v1/setup/auth-policy \ --header 'Content-Type: application/json' \ --data '{ "accessTokenMinutes": 1, "refreshTokenHours": 1, "otpTtlMinutes": 1, "passwordMinLength": 1, "passwordLoginEnabled": true, "otpLoginEnabled": true, "allowedEmailDomains": [ "example" ], "publicUrl": "example" }'Step 5. Stores token lifetimes (access 1–60 minutes, refresh 1–720 hours), the sign-in link lifetime, the minimum password length (8–128), which sign-in methods are enabled, the allowed email domains (empty = any) and the public URL used in emailed links. Administrators only. 400 when both sign-in methods are disabled or a value is out of range.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
accessTokenMinutes
integer | string format: int32
refreshTokenHours
integer | string format: int32
otpTtlMinutes
integer | string format: int32
passwordMinLength
integer | string format: int32
passwordLoginEnabled
boolean
otpLoginEnabled
boolean
allowedEmailDomains
Array<string>
publicUrl
string
Examplegenerated
{ "accessTokenMinutes": 1, "refreshTokenHours": 1, "otpTtlMinutes": 1, "passwordMinLength": 1, "passwordLoginEnabled": true, "otpLoginEnabled": true, "allowedEmailDomains": [ "example" ], "publicUrl": "example"}Responses
Section titled “Responses”No Content