Requires Sign In Widget version 2.5.0 or above
In order for Okta's IdP Discovery policies to initialize for the SIW (Sign in Widget), a user must enter their existing credentials and trigger a login request. This can be a "chunky" user experience if the user is arriving from a link or external portal. To streamline this experience, a developer may want to auto populate the email upon loading and trigger the routing rules immediately.
🔅 Preview Glitch example
Pass along the context of the user's email in a query string, and leverage the sign in widget's context state and event handlers to populate the username field to trigger the login.
Append a url encoded query string with the user's email to the link of your sign in page:
Note: the query parameter doesn't need to be limited to username, you can name the parameter anything you please
It's important to mention that query strings are exposed in the user's browsers history and on server logs. Therefore, make an appropriate decision in regards to security and user-experience.
Kudos to the EMEA CIAM Specialists team for the origins of this use case and solution and Brandon Him (@brh55) for writing and finalizing the recipe.