Hosted authentication
This page describes the browser-owned oauth_tokens sequence. For a WEB client with HttpOnly Cookie sessions,
use the BFF sequence; the BFF owns bootstrap, protocol callback and code exchange.
Hosted authentication redirects the browser to the Vertex authorization endpoint. Vertex owns credential entry, provider choice, step-up challenges, and policy errors on its origin. The application owns starting the request, persisting OAuth state and the PKCE verifier, validating the callback, and establishing its own UI state.
Browser sequence
- Generate an unpredictable
stateand PKCE verifier. - Derive the S256 challenge and start authorization for the SPA public client.
- Vertex authenticates the user and returns an authorization code to the exact registered URI.
- Validate
state, exchange the code with the verifier, and remove callback parameters. - Send the access token only to the intended resource audience.
Never place a client secret in a hosted SPA. A WEB/BFF performs the exchange server-side with both its secret and PKCE verifier.
Use <SignIn mode="redirect" /> or useAuth().login() inside IamProvider instead of implementing these steps
by hand. The registered standalone callback uses handleRedirectCallback; handle its success, error, idle and
any continuation result explicitly. See the JavaScript callback guide.
An invitation popup has different callback ownership: its passive callback is consumed by the opener.
Hosted pages resolve the target Application's brand and policy from the configured client. Hosting the page on the Vertex origin does not make it a generic console login or change ownership of the Application's authentication policy.