Skip to main content

OpenID Connect (SSO)

Sign users in at the gateway against an identity provider, and pass who they are to the app.

Typeoidc
CategoryAccess
RequiresGoma Gateway 0.14.0 or newer
Gateway version

A route using this middleware fails to load on a gateway older than 0.14.0. Miabi does not read the running gateway's version, so nothing stops you saving it — the route is what reports the problem.

Fields

FieldTypeRequiredDefaultDescription
issuertextnoThe provider's issuer. Everything else is discovered from it, so the endpoints below are only for a provider without a discovery document. Example: https://id.example.com/application/o/app/.
clientIdtextyesClient ID.
clientSecrettextyesClient secret. Secret — encrypted at rest, never returned by the API.
providerone of custom, google, github, gitlab, amazon, facebooknoA well-known provider fills in its own endpoints.
scopeslist of textnoRequested scopes. Most providers need at least openid, email and profile. Example: openid.
audiencetextnoEnforced as the aud claim on JWT access tokens. The ID token is always checked against the client ID.
endpointgroupnoOnly needed without an issuer, or to override what discovery returns.
callbackPathtextnoWhere the provider returns the user. Register this exact path with the provider. Defaults to the route path plus /oauth2/callback. Example: /oauth2/callback.
logoutPathtextnoEnds the session when requested. Not served unless set. Example: /oauth2/logout.
postLoginRedirecttextnoEmpty returns the user to the page they asked for. Example: /dashboard.
postLogoutRedirecttextnoAfter sign-out. Example: /.
pkcetrue/falsenotrueProof key on the code exchange. Leave on unless the provider rejects it.
sessiongroupnoSession.
claimsExpressiontextnoWho is allowed in once signed in. Users who do not match get 403. Example: Contains('groups', 'engineering').
claimsSourcelist of textnoWhere claims are read from, in increasing precedence: access_token, userinfo, id_token. Example: id_token.
forwardgroupnoSend identity to the app.

endpoint

Only needed without an issuer, or to override what discovery returns.

FieldTypeRequiredDefaultDescription
authUrltextnoAuthorization URL.
tokenUrltextnoToken URL.
jwksUrltextnoVerifies JWT access tokens and ID tokens.
userInfoUrltextnoVerifies opaque tokens, and supplies claims.

session

FieldTypeRequiredDefaultDescription
storeone of cookie, memory, redisnoCookie needs no shared state. Redis shares sessions across gateway replicas and needs Redis configured on the gateway.
secrettextnoKeys the sealing of session data. Defaults to the client secret; changing it signs everyone out. Secret — encrypted at rest, never returned by the API.
ttlduration (e.g. 10m)noHow long a session lives regardless of activity. Example: 12h.
idleTimeoutduration (e.g. 10m)noIdle timeout. Example: 1h.
cookiegroupnoCookie.

session.cookie

FieldTypeRequiredDefaultDescription
nametextnoName. Example: goma_session.
pathtextnoDefaults to the route path, so two routes on one host do not share a session. Example: /.
domaintextnoDomain.
sameSiteone of lax, strict, nonenoStrict breaks the provider's callback redirect.
securetrue/falsenoDefaults to whether the request arrived over TLS.

forward

FieldTypeRequiredDefaultDescription
headerskey/value mapnoDot notation reaches nested claims; a template like "{{ .given_name }} {{ .family_name }}" joins several.
querykey/value mapnoClaims as query parameters.
cookieskey/value mapnoAdded to the request sent upstream, never to the browser's response.
stripInboundtrue/falsenotrueLeave on. Off lets a caller send these headers itself and choose who your app thinks it is.
arraySeparatortextnoArray separator. Example: ,.
encodingone of auto, rawnoAuto base64-encodes non-ASCII values, which headers cannot carry, and flags them.
maxValueBytesnumbernoMaximum value size. Example: 4096.
accessTokenHeadertextnoLets the app verify the token itself instead of trusting a header. Example: Authorization.
idTokenHeadertextnoForward the ID token. Example: X-Auth-Id-Token.
Secret fields

Fields marked secret are encrypted at rest and never returned by the API. Editing the middleware leaves a stored secret in place unless you type a new value — an empty box means "keep what is stored", not "clear it".