dcloud 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.
Synopsis
dcloud deploy login-gate put id --provider provider [flags]Arguments
<id>Requiredstring
Also accepted as
--id. Constraints: uuid
Flags
--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,token--token-jwksOptionalstring
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
--token-cookieOptionalstring
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}$/
--token-issuerOptionalstring
provider token: require this iss; omitted, iss is not checked
Constraints: 1-512 chars
--token-audienceOptionalstring
provider token: require this aud; omitted, aud is not checked
Constraints: 1-512 chars
--redirect-urlOptionalstring
provider token: where a browser without a valid token is sent, with ?return_to=<the URL it asked for>
Constraints: url, max 2048 chars
--oidc-issuerOptionalstring
provider oidc: the issuer URL; its /.well-known/openid-configuration must be reachable
Constraints: url, max 2048 chars
--oidc-client-idOptionalstring
provider oidc: the client ID
Constraints: 1-512 chars
--oidc-client-secretOptionalstring
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
--allowed-email-domainsOptionalarray 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:
[]--webhook-urlOptionalstring
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.
--webhook-secretOptionalstring
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
--session-hoursOptionalnumber
How long a sign-in lasts before the person signs in again (1 to 168 hours)
Constraints: integer, 1-168
Default:
24--exceptionsOptionalarray 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:
[]--acknowledge-open-accessOptionalboolean (--acknowledge-open-access / --no-acknowledge-open-access)
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).
Example
dcloud deploy login-gate put id --provider consoleGenerated from the API description, the same one the API checks requests against and the CLI is built from.