Identity Services

Understand identity services prerequisites and how to integrate your existing identity with OIDC.

Layer5 Cloud offers a built-in identity provider (IDP), supporting OIDC for normal users and token-based authentication (access, ID, refresh tokens) for API clients with JSON Web Signature (JWS) for token signing. Layer5 Cloud users can sign-up via email and password in addition to social identity providers (Google and GitHub) via OAuth2. See Getting Started with a Layer5 Account for details.

Layer5 Cloud identity services include account recovery, email verification, and social sign-in with Google and GitHub. Password sign-in is on, with a minimum of 8 characters, a check against known-breached passwords, and a rejection when the password is too similar to the account identifier.

Ory Kratos owns user accounts and sign-in. Ory Hydra issues OAuth2 tokens. The Layer5 Cloud server connects the two to organizations, teams, and roles. Social sign-in is Google and GitHub. Access tokens are JWTs, valid 24 hours. Refresh tokens are valid 1000 hours, ID tokens 1 hour, and authorization codes 1 hour. Login flows must finish within 12 hours (720m). Registration flows last 24 hours. Recovery and verification flows last 30 days (720h) and use codes.

By default, every organization signs users in through your deployment’s shared (default) identity providers - the Google and GitHub OAuth applications configured for the Provider Organization. Users see those applications’ name and logo on the Google or GitHub consent screen, and no per-organization setup is required.

An organization can optionally bring its own credentials (BYOC): its own Google OAuth client, GitHub OAuth App, or an OIDC provider. With BYOC, the upstream consent screen and the exchange can carry the organization’s own branding. The organization’s administrators register the credentials themselves. Provider Admins can do it for any organization. See Configuring Identity Providers.

BYOC is always optional. Social sign-in (Google and GitHub) works out of the box on every custom domain - including a fully-custom domain on a different base domain (the registrable domain, or eTLD+1) from your deployment - using the deployment’s default identity providers. You bring your own credentials only when you want your own brand, controls, or isolation, never to make social sign-in available:

Organization’s domainDefault identity providersBYOC
No custom domain, or a subdomain of the deployment’s base domain (e.g. team.example.com on a cloud.example.com deployment)Social sign-in works out of the boxOptional - only for your own branding, scale, or isolation
A fully-custom domain on a different base domain (e.g. meshery.yourcompany.com pointed at the hosted cloud.layer5.io)Social sign-in works out of the boxOptional - only for your own branding, scale, or isolation

On a fully-custom domain, the Google and GitHub buttons are shown alongside email-and-password sign-in and work without any per-organization configuration. Configuring the organization’s own identity providers (BYOC) changes whose OAuth apps and consent screen are used - it does not gate whether social sign-in is available.

When you are reasoning about which organizations sit inside the same authentication boundary, look at the connected identity provider - not at the name or DNS shape of the host:

Same identity provider source means the same security boundary.

Organizations that share an identity provider sit within the same authentication boundary; an organization that brings its own provider (BYOC) is a distinct authentication boundary. This holds regardless of which class of host an organization is reached on:

Host classExampleIdentity provider it usesAuthentication boundary
Canonical hostcloud.layer5.ioThe deployment’s shared, central providerThe shared boundary
On-eTLD custom host (a subdomain under the same base domain as the canonical host)partner.layer5.io on a cloud.layer5.io deploymentThe same shared, central providerThe same shared boundary as the canonical host
Off-eTLD custom host (a fully-custom domain on a different base domain)meshery.yourcompany.com pointed at cloud.layer5.ioThe same shared, central provider (unless BYOC is configured)The same shared boundary as the canonical host (unless BYOC is configured)
Any host, with BYOCany of the above, after configuring BYOCThe organization’s own dedicated providerA distinct boundary

By default, every host class - canonical, on-eTLD, and off-eTLD - draws on the shared, central identity provider, so organizations reached through them sit within one shared authentication boundary. An organization with its own (BYOC) identity provider is its own boundary, no matter how its host is named. The DNS shape of the host is not the boundary - the identity provider behind it is.

This is the authentication (host-class) view of the boundary. It composes with the authorization view - where each organization context independently scopes what a user is permitted to do via keys, keychains, and roles - and with granular resource-access sharing that can cross organizations. For the complete picture of how these layers fit together, see Identity and Security β†’ Security Boundaries.

CapabilityDefault
Password sign-inOn. Minimum 8 characters.
Email verificationRequired before a password sign-in succeeds. Delivered as a code.
Account recoveryOn, delivered as a code.
Social sign-inGoogle and GitHub are enabled but have no credentials until you add them.
Session lifespanNot set by the chart. Kratos applies its own default. See Sessions.

Change these through kratos.kratos.config and hydra.hydra.config. Both are passed to the Ory services unchanged.

You supply the defaults as two OAuth applications, and the deployment uses them in two places. Use the same application for both.

WhereUsed forConfigured with
KratosSocial sign-in and sign-up on the deployment’s own hostname, and social sign-up on every hostnameclient_id and client_secret of the github and google entries under kratos.kratos.config.selfservice.methods.oidc.config.providers
Layer5 Cloud serverSocial sign-in on organization custom domainsenv.providerOrgGithubKey, env.providerOrgGithubSecret, env.providerOrgGoogleKey, env.providerOrgGoogleSecret
ProviderAddresses to register
Googlehttps://<host>/kratos/self-service/methods/oidc/callback/google and https://<host>/oidc/callback/google. Google matches redirect addresses exactly.
GitHubhttps://<host>/. GitHub matches by path prefix, so the host root covers both callbacks.

You register addresses on your deployment hostname only. A custom-domain organization that uses the default providers completes the exchange on your hostname and returns to its own domain.

At every start, the server reads the env.providerOrg* values and stores each pair it finds, encrypted with env.cloudCredentialEncryptionKey, as a credential and connection in an administrative environment of the provider organization.

  • A provider needs both its key and its secret. A provider with only one set is skipped.
  • The server needs an administrator first. The seed waits until the provider organization has a member. Provider initialization creates that member on first start, and the seed runs on the same start.
  • Stored credentials are not overwritten. After the first successful seed, changing env.providerOrg* and redeploying does not change what the server uses. Replacing them means replacing the stored credential in the database. Ask support when you must rotate.

The seed never blocks startup. When it fails, sign-in on custom domains that rely on the defaults fails until a later start succeeds. Search the startup log for IdP seed messages.

Related Reading