dcloud deploy login-gate put

Require sign-in on an app, or change who may sign in

IAM deploy:PutLoginGateChanges stateAsks before it deletes (-y skips)

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>Required

    string

    Also accepted as --id. Constraints: uuid

Flags

  • --providerRequired

    enum

    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-jwksOptional

    string

    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-cookieOptional

    string

    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-issuerOptional

    string

    provider token: require this iss; omitted, iss is not checked

    Constraints: 1-512 chars

  • --token-audienceOptional

    string

    provider token: require this aud; omitted, aud is not checked

    Constraints: 1-512 chars

  • --redirect-urlOptional

    string

    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-issuerOptional

    string

    provider oidc: the issuer URL; its /.well-known/openid-configuration must be reachable

    Constraints: url, max 2048 chars

  • --oidc-client-idOptional

    string

    provider oidc: the client ID

    Constraints: 1-512 chars

  • --oidc-client-secretOptional

    string

    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-domainsOptional

    array 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-urlOptional

    string

    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-secretOptional

    string

    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-hoursOptional

    number

    How long a sign-in lasts before the person signs in again (1 to 168 hours)

    Constraints: integer, 1-168

    Default: 24

  • --exceptionsOptional

    array 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-accessOptional

    boolean (--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 console

Generated from the API description, the same one the API checks requests against and the CLI is built from.