Skip to main content

OIDCInteractionState

Package: @nauth-toolkit/client Type: Interface

What the consent screen needs in order to ask the user. Returned by client.oidc.getInteraction().

import type { OIDCInteractionState } from '@nauth-toolkit/client';

Properties​

PropertyTypeDescription
clientOIDCInteractionClientThe client making the request, as the user should see it
gateOIDCGateStatusThe session verdict
gateReasonstringWhy, when the gate is not authenticated
missingScopesstring[]Scopes still needing consent — the rest are already granted
prompt'login' | 'consent' | stringWhat the provider is asking for
scopesstring[]Scopes the client asked for
substringExternal identifier of the signed-in user, when there is one
uidstringThe pending interaction id

Render missingScopes rather than scopes when it is non-empty — it is the shorter list a returning user should be asked about.

gateReason is 'no_session', 'password_change_required' or 'email_verification_required' for a login_required gate, and 'account_disabled', 'account_locked' or 'account_unavailable' for a denied one.

OIDCInteractionClient​

PropertyTypeDescription
clientIdstringPublic client identifier
clientNamestringHuman-readable name. Fall back to clientId
clientUristringThe client's home page
logoUristringLogo to show on the consent screen

Example​

{
"uid": "kPz3Q8sLm2",
"prompt": "consent",
"client": {
"clientId": "partner",
"clientName": "Partner App",
"clientUri": "https://myapp.com"
},
"scopes": ["openid", "email", "profile"],
"missingScopes": ["email", "profile"],
"gate": "authenticated",
"sub": "6f1c0f8e-8b1a-4a2e-9d4c-3f1e2a7b5c90"
}

Used By​

What's Next​