I'm weighing two design approaches here. The first would automatically redirect to OIDC whenever the iss parameter is present, creating a seamless experience that aligns with how Okta expects the initiate_login_uri to work. The second option is simpler—just show a "Continue with Okta" button with a hint, requiring one click from the user. Based on what the user is asking for, they seem to prefer the second approach, though they might want both options available. Going with the simpler solution feels like the safer bet.
For auto-start, I need to think through the security implications. The main concern is validating that the iss value actually matches our configured provider's issuer. Right now the config only exposes the provider ID and name, so I'd need to add the issuer URL to the config (pulled from the discovery endpoint) so the frontend can verify it. That's an extra backend change. Alternatively, I could just check that iss is present and OIDC is configured—since the flow only ever goes to our configured provider, an attacker can't redirect anywhere else. Worst case, someone crafts a link with ?iss=whatever that bounces a visitor into our SSO flow, which is a minor issue but not a blocker. There's also a loop risk if the flow errors and redirects back to /login without the iss parameter, but that should be fine since the error param is already handled.
I think the right move is to go with the simpler approach—show the button with a guard in place, and skip the auto-start for now.
Since the user's second message already clarifies what they want ("we just put a button continue with okta so the user is not lost"), I'll implement that design and mention auto-start as a possible follow-up.
For the implementation, I need to add iss to the search validation in the login component, compute whether this is an IDP-initiated flow, and pass that context to the auth form so it can conditionally hide the email/password fields and restrict the social providers to just the OIDC option.
I'm thinking through the cleanest prop naming — something like oidcOnly would work well, where the auth form checks this flag and when true, it filters the provider list down to just OIDC and hides the email/password form with an explanatory message.
Refining the approach... While loading the oidcConfig, I need to decide whether to hide the email form to avoid a jarring flash. The safest approach is checking if oidcOnly is requested AND we have the config data, so oidcOnly && !!oidcConfig.data — this keeps the logic simple and accepts a brief moment of the full form on initial render.
For the iss parameter, I'm passing it through the existing socialCallbackUrl flow in the signIn.oauth2 call, which handles the redirect cleanly. Since we're only rendering a button based on the value, there's no security concern with validation.