deploy.login-gate.putRequire sign-in on an app, or change who may sign in
The gate covers every hostname of the app: its default name, custom domains, compose services’ names and preview environments. The machines enforce it themselves (effective on their next poll, within seconds); a machine whose software predates the gate serves nothing until it updates. A browser without a session is sent to sign in; any other request gets 401. The app receives the signed identity in X-Dcloud-Identity (an RS256 JWT, aud = the app id, verify with jwksUrl) and the email in X-Dcloud-User-Email; copies a client sends are removed. A change of provider, issuer, client, domains or webhook URL ends every existing session.
Request syntax
PUT /deploy/api/apps/{id}/login-gate
{
"provider": "enum",
"tokenJwks": "string",
"tokenCookie": "string",
"tokenIssuer": "string",
"tokenAudience": "string",
"redirectUrl": "string",
"oidcIssuer": "string",
"oidcClientId": "string",
"oidcClientSecret": "string",
"allowedEmailDomains": "array of json",
"webhookUrl": "string",
"webhookSecret": "string",
"sessionHours": "number",
"exceptions": "array of string",
"acknowledgeOpenAccess": "boolean"
}Path parameters
idRequiredstring
Constraints: uuid
Request body
providerRequiredenum
console: members of the app’s organization whose policies allow deploy:AccessApp on the app sign in with their console account. oidc: your own identity provider. token: requests must carry a JWT your own service signs with a key you register (tokenJwks); others are sent to redirectUrl.
One of:
console,oidc,tokentokenJwksOptionalstring
provider token: your public keys as a JWKS document ({"keys": [...]}): RSA (2048 bits or more, RS256) or EC P-256 (ES256), never a private key or a secret; up to 10, kids unique
Constraints: max 65536 chars
tokenCookieOptionalstring
provider token: the cookie that carries the token (an Authorization: Bearer header is read too); default dcloud_token
Constraints: /^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$/
tokenIssuerOptionalstring
provider token: require this iss; omitted, iss is not checked
Constraints: 1-512 chars
tokenAudienceOptionalstring
provider token: require this aud; omitted, aud is not checked
Constraints: 1-512 chars
redirectUrlOptionalstring
provider token: where a browser without a valid token is sent, with ?return_to=<the URL it asked for>
Constraints: url, max 2048 chars
oidcIssuerOptionalstring
provider oidc: the issuer URL; its /.well-known/openid-configuration must be reachable
Constraints: url, max 2048 chars
oidcClientIdOptionalstring
provider oidc: the client ID
Constraints: 1-512 chars
oidcClientSecretOptionalstring
provider oidc, write-only: the client secret. Required the first time and when the issuer or client changes; omit to keep the stored one.
Constraints: 1-4096 chars
allowedEmailDomainsOptionalarray of json
Admit only these email domains, matched exactly (example.com does not admit eu.example.com). Only an address the provider marks verified (email_verified) is matched.
Default:
[]webhookUrlOptionalstring
An access webhook called once per sign-in; it answers {"allow": true} to admit. Omit or null for none.
Constraints: url, max 2048 chars
May be null.
webhookSecretOptionalstring
Write-only: the HMAC-SHA256 key of the X-Dcloud-Signature header. Required with a new webhook; omit to keep the stored one.
Constraints: 16-256 chars
sessionHoursOptionalnumber
How long a sign-in lasts before the person signs in again (1 to 168 hours)
Constraints: integer, 1-168
Default:
24exceptionsOptionalarray of string
Path prefixes served without sign-in: /healthz matches /healthz and /healthz/…; /hooks/ matches everything under /hooks/. Requests to them carry no identity.
Constraints: max 200 chars, /^\/[A-Za-z0-9\-._~!$&'()*+,=:@/]*$/
Default:
[]acknowledgeOpenAccessOptionalboolean
oidc without allowedEmailDomains or a webhook admits everyone the provider signs in. Set true to confirm that is intended (refused for public providers such as Google).
Response
201 with `data` when the gate is switched on, 200 when changed. 409 when the settings would admit anyone (a public provider without allowedEmailDomains or a webhook), a secret is missing, or the app is a preview environment; 422 when the issuer’s discovery document cannot be read.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
appIdAlwaysstring
The appenabledAlwaysboolean
Whether the app requires sign-in on every hostnameproviderAlwaysone of console, oidc, token, may be null
console accounts, your OpenID Connect provider, or tokens your own keys sign; null while offtokenJwksAlwaysstring, may be null
provider token: the registered public keys (JWKS)tokenCookieAlwaysstring, may be null
provider token: the cookie the token is read fromtokenIssuerAlwaysstring, may be null
provider token: the required iss; null = anytokenAudienceAlwaysstring, may be null
provider token: the required aud; null = anyredirectUrlAlwaysstring, may be null
provider token: where a browser without a valid token is sent (with return_to)oidcIssuerAlwaysstring, may be null
provider oidc: the issuer URLoidcClientIdAlwaysstring, may be null
provider oidc: the client IDoidcClientSecretSetAlwaysboolean
A client secret is stored (it is never returned)allowedEmailDomainsAlwaysarray of string
Admitted email domains, exact; empty = anywebhookUrlAlwaysstring, may be null
The access webhook, if anywebhookSecretSetAlwaysboolean
A webhook secret is stored (it is never returned)sessionHoursAlwaysnumber, may be null
How long a sign-in lastsexceptionsAlwaysarray of string
Path prefixes served without sign-inepochAlwaysnumber
Raised by revoke-sessions and by changes of who may sign in; older sessions endupdatedAtAlwaysstring, may be null
When the gate was last changed; null for neverredirectUriAlwaysstring
The redirect URI to register at your identity provider (the same for every app)issuerAlwaysstring
The `iss` of the identity tokenjwksUrlAlwaysstring
Where the keys that verify the identity token are publishedidentityHeaderAlwaysstring
The request header the app receives the token inemailHeaderAlwaysstring
The request header with the signed-in email, for conveniencesignOutPathAlwaysstring
Open this path on any hostname of the app to sign out
Checked against the handlers: every route test validates their answers against this schema.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow deploy:PutLoginGate on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud deploy login-gate put id --provider consolecurl -X PUT "https://console.platform.deutschecloud.app/deploy/api/apps/id/login-gate" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"console"}'import { DcloudClient } from '@dcloud/sdk';
const client = new DcloudClient();
const result = await client.deploy.loginGate.put({ id: "id", provider: "console" });from dcloud import Client
client = Client()
result = client.deploy.login_gate.put(id="id", provider="console")Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_login-gate_put.