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
issuertextno—The 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/.
clientIdtextyes—Client ID.
clientSecrettextyes—Client secret. Secret — encrypted at rest, never returned by the API.
providerone of custom, google, github, gitlab, amazon, facebookno—A well-known provider fills in its own endpoints.
scopeslist of textno—Requested scopes. Most providers need at least openid, email and profile. Example: openid.
audiencetextno—Enforced as the aud claim on JWT access tokens. The ID token is always checked against the client ID.
endpointgroupno—Only needed without an issuer, or to override what discovery returns.
callbackPathtextno—Where the provider returns the user. Register this exact path with the provider. Defaults to the route path plus /oauth2/callback. Example: /oauth2/callback.
logoutPathtextno—Ends the session when requested. Not served unless set. Example: /oauth2/logout.
postLoginRedirecttextno—Empty returns the user to the page they asked for. Example: /dashboard.
postLogoutRedirecttextno—After sign-out. Example: /.
pkcetrue/falsenotrueProof key on the code exchange. Leave on unless the provider rejects it.
sessiongroupno—Session.
claimsExpressiontextno—Who is allowed in once signed in. Users who do not match get 403. Example: Contains('groups', 'engineering').
claimsSourcelist of textno—Where claims are read from, in increasing precedence: access_token, userinfo, id_token. Example: id_token.
forwardgroupno—Send identity to the app.

endpoint​

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

FieldTypeRequiredDefaultDescription
authUrltextno—Authorization URL.
tokenUrltextno—Token URL.
jwksUrltextno—Verifies JWT access tokens and ID tokens.
userInfoUrltextno—Verifies opaque tokens, and supplies claims.

session​

FieldTypeRequiredDefaultDescription
storeone of cookie, memory, redisno—Cookie needs no shared state. Redis shares sessions across gateway replicas and needs Redis configured on the gateway.
secrettextno—Keys 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)no—How long a session lives regardless of activity. Example: 12h.
idleTimeoutduration (e.g. 10m)no—Idle timeout. Example: 1h.
cookiegroupno—Cookie.

session.cookie​

FieldTypeRequiredDefaultDescription
nametextno—Name. Example: goma_session.
pathtextno—Defaults to the route path, so two routes on one host do not share a session. Example: /.
domaintextno—Domain.
sameSiteone of lax, strict, noneno—Strict breaks the provider's callback redirect.
securetrue/falseno—Defaults to whether the request arrived over TLS.

forward​

FieldTypeRequiredDefaultDescription
headerskey/value mapno—Dot notation reaches nested claims; a template like "{{ .given_name }} {{ .family_name }}" joins several.
querykey/value mapno—Claims as query parameters.
cookieskey/value mapno—Added 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.
arraySeparatortextno—Array separator. Example: ,.
encodingone of auto, rawno—Auto base64-encodes non-ASCII values, which headers cannot carry, and flags them.
maxValueBytesnumberno—Maximum value size. Example: 4096.
accessTokenHeadertextno—Lets the app verify the token itself instead of trusting a header. Example: Authorization.
idTokenHeadertextno—Forward 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".