Authentication server (authn-server)

About the service

ParameterDescription
System name chartshturval-auth
Componentsh-authn
Cluster AssignmentOIDC/OAuth2, interactive login, logout, issuing and revoking tokens, JWKS, working with session cookies.
CriticalYes
Namespaceshturval-backend

authn-server is included in the Helm chart shturval-auth. auth-controller, session-manager and ldap-cache are deployed in the same chart.

Contents

  1. Review
  2. Architecture
  3. Installation/deployment
  4. Diagnostics
  5. Lifecycle
  6. Service parameters

1. Review

Purpose: to serve browser and software platform authentication scenarios: discovery OIDC (/.well-known/openid-configuration), login/logout, issuance and revocation of codes and tokens, JWKS, user cookie sh_session_id, as well as monitoring the configuration of OAuth clients and identity providers.

Features

ContourPurpose
Login/logoutBrowser scripts and redirect login.
OAuth2 endpointauthorize, token, introspect, revoke, user info.
Session storeServer state of user sessions.
Client watcherMaintaining an up-to-date catalog of OIDC clients from AuthOidcClient.
LDAP/external IdPUpdating the configuration from the Secret platform.

Initiation scripts

EventInitiatorEffect
The user logs inBrowser or clientCookies and tokens are issued according to the release policy.
Modified by AuthOidcClientKubernetes watcherThe set of OAuth clients in the service memory is updated.
Changed Secret LDAP / IdP configurationPlatform AdministratorAuthorization parameters are updated.
Readiness testkubelet/readyz checks the availability of associated stores.

Limitations and implications

LimitConsequence
The JWT file key is looked for in the working directoryThe container should receive the private.pem file via volume mount.
Cookie name sh_session_id is fixed by product version codeIt cannot be renamed through the normal configuration.
Endpoint corp root CA requires /shturval/corp-root-ca.crtWhen using the script, provide a certificate mount.
Without TOKEN_STORE_ADDR and SESSION_STORE_ADDR memory mode is possibleFor multiple pods, use external Redis storage.

Place in the chain of command

authn-server receives OAuth clients from AuthOidcClient, which are negotiated by auth-controller. User sessions are created by authn-server and are then viewable and deleted via session-manager. For LDAP scenarios, the directory configuration is also used ldap-cache.

Key Features

CharacteristicsDescription
Binarsh-authn
Process portPORT, default 8081
AccommodationTemplate helm/auth/templates/dep-authn.yaml, shared pod with sh-session-manager
StorageRedis or in-memory mode if store addresses are not specified

2. Architecture

ComponentRole
sh-authnHTTP endpoint routing OIDC/OAuth2.
Token store backendStoring OAuth codes, access token and refresh token.
Session store backendServer state of user sessions.
Kubernetes watchersMonitoring client CR and Secret LDAP/IdP.
sh-session-managerAPI for lists and session clearing, called by backend.

3. Installation / deployment

The service is managed by Helm chart shturval-auth. For multi-pod operation, enable remote Redis stores for tokens and sessions; otherwise the entries in the memory of different pods will not be consistent.

Parameters are changed via ShturvalServicePatch (SSP) for SSC shturval-auth.

4. Diagnosisteak

kubectl get pods -n "${NAMESPACE}" -o wide
kubectl logs -n "${NAMESPACE}" "${POD}" -c sh-authn --tail=300
kubectl logs -n "${NAMESPACE}" "${POD}" -c sh-session-manager --tail=150

Substitute POD for actual installation.

SymptomPossible reasonAction
Login breaks in multi-pod modeRedis unavailableCheck SESSION_STORE_ADDR and TOKEN_STORE_ADDR.
Readiness always falseOne of the storages is unavailableCheck log errors and credentials in Secret.
OAuth clients do not authorize requestsAuthOidcClient not consistentCheck the status of auth-operator resources.

5. Life cycle

StepMemberResult
1Ingress/LBLogin to pod.
2Process RouterSelecting the desired OAuth/OIDC handler.
3Store/watchersReading validated authorization objects from memory and storage.
4Response to clientRedirect, JSON JWKS or token payload.

Stateful reconcile is not used: the service processes HTTP requests and watchers events.

6. Service parameters

VariablePurpose
PORTProcess port, default 8081.
KEY_ID, ISSUER, TOKEN_URL, AUTH_URLOIDC metadata of the signing process.
AT_EXP, RT_EXP, GEN_RTToken and refresh token expiration policies.
SESSION_STORE_ADDR, TOKEN_STORE_ADDRSwitch memory mode to Redis at a given address.
COOKIE_DOMAINBrowser cookie area.
USE_BOOTSTRAP_HOST_AS_ISSUERBootstrap HTTP behavior.
POD_NAMESPACENamespace Observations Secret and CR.

For a production environment, check mount private.pem, CA bundle and Redis availability.