Skip to main content
User guide

Identity authentication

Put a sign-in step in front of protected sites with gateway users and one-time codes, access approval, LDAP, single sign-on through OIDC, GitHub, CAS, DingTalk and WeCom, and per-site scope and session settings.

Business and API security > Identity authentication (身份认证) is a sign-in gateway in front of protected sites. Visitors to a site with identity authentication sign in first and are forwarded to the upstream only afterwards; the upstream can read the signed-in identity from request headers. For signing in to the console itself, see Accounts and permissions.

The page has seven tabs: gateway users, access approval, user source, identity providers, single sign-on, sites and sign-in log. The top shows the gateway's status, such as not deployed, configuration being applied, configuration not applied, restarting or not responding.

Prerequisites

  • The site has an HTTPS port, redirects HTTP to HTTPS and does not use a wildcard domain.
  • In a multi-node deployment, nodes must reach ports 9445 and 9446 on the control plane host. If they cannot, protected paths return 502 (connection refused or not established within 5 seconds) or 504 (no response within 15 seconds), and nothing is passed to the upstream.
  • While the control plane is down, sites with identity authentication return 502.

User source

SourceDescription
Built-in users (内置用户)Default. Create them under Gateway users (网关用户) with user name, display name, email and groups. The initial password and the one-time code QR code are shown once. Passwords can be reset, one-time codes set or removed, and users disabled
LDAPType: Active Directory, OpenLDAP (RFC2307bis), FreeIPA, LLDAP, GLAuth or custom. Enter the address, base DN, bind account and password, and the additional DNs and filters for users and groups, then Test connection and Save and switch (保存并切换). Needs a Standard or higher licence

Single sign-on

Add providers under Identity providers (身份提供方). The page shows the callback URL to register with the provider:

TypeDescription
OIDCKeycloak, Azure AD, Okta, Authing, and the OIDC endpoints of Feishu or DingTalk, among others. Enter the issuer, client ID and secret, scopes and claim mapping; UserInfo can be merged and signing out can also sign out of the provider
GitHub / GitHub EnterpriseCan be limited to allowed organisations
CAS 2.0 / 3.0
DingTalkQR sign-in or in-app sign-in, with optional organisation membership check
WeComQR sign-in or in-app authorisation, with optional organisation membership check

SAML is not supported. Provider addresses must use HTTPS, except internal addresses, which may use HTTP. In offline mode only internal addresses can be reached, so the public cloud services of DingTalk and WeCom work only with RSTWAF_ONLINE_FEATURES=on; dedicated or privately deployed instances on internal addresses work offline.

The Single sign-on (单点登录) tab sets the SSO centre used for cross-domain sign-on (an HTTPS site domain) and the session idle and maximum lifetimes, and lists active sessions, which you can end.

Turn it on for a site

Under Sites and nodes, open the Identity authentication tab in the site details:

SettingDescriptionDefault
Sign-in protectionOn or off
ScopeWhole site or selected protected paths
Exempt pathsPaths that need no sign-in
Sign-in methodGateway account (password plus one-time code, or password only) or single sign-on (choose a provider)
Allowed users / groupsOnly listed users or groups get access
Identity headersHeader names for user name, groups, display name and email passed to the upstream
Bind session to client IPA change of client IP requires signing in again
Idle timeout1 to 1440 minutes60
Maximum session lifetimeUp to 43200 minutes720
Access approvalNew users need administrator approval on first access

With access approval on, pending requests appear under Access approval (访问审批), where they can be approved, rejected or revoked.

Sign-in log

Query by site, user name, IP, sign-in method, event (sign-in, one-time code, sign-out, revoke) and result (success, failure, denied), and export. Entries are kept for 180 days.

Limits

  • The Kubernetes Helm chart does not include the identity gateway.
  • The gateway's session and one-time code secrets are kept in .env. Rotating RSTWAF_AUTHGW_STORAGE_KEY makes enrolled one-time codes unreadable, and they must be enrolled again in the console.

On this page