shadcn.io is not affiliated with official shadcn/ui
SAML Redirect Login Block for React
A sign-in page for payroll that walks through a SAML hand-off one step at a time: five read-only steps, a Now at address, Start redirect, Step and Cancel, and the facts and typed request the two sides agree on.
Installation
Overview
Show people what happens between your page and their identity provider, with this SAML redirect login block for React with Base UI. It's the sign-in page of Wagetrove, payroll: the page's side rails run the full height of the screen and one band crosses it between two rules, split in two. At the start, the heading, a Now at line with the address the browser would be on, and the catalog's vertical Steps, read-only: Request built, Redirected to the provider, You sign in there, Assertion posted back, Session created. The Shine Button, the only colored control, runs the five steps once, 700 ms each, and stops by itself; Step does one at a time with no timer, and Cancel starts over. Each step's marker fills as it finishes, its row says Done, In progress or Next in words, and a polite line says where the run is. At the end, behind a divider, the entity ID, the assertion consumer URL, the bindings and the provider, and a disclosure with the typed SAML request. It's built from Steps, Button, Shine Button and Guides, with a CSS entrance only. For payroll, HR and finance tools whose customers sign in through their own identity provider.
FAQ
Does anything redirect, and how do I wire a real SAML sign-in?
Nothing redirects and nothing is sent. The steps, the addresses and the request are typed, and the page only walks through them; it says so in its polite status line. In a product, build a signed AuthnRequest on your server, redirect the browser to the identity provider's single sign-on URL with it (the HTTP-Redirect binding), receive the provider's signed response at your assertion consumer URL (the HTTP-POST binding), check the signature, the audience and the time conditions, and only then create the session. Replace the five steps' text with what your flow does and keep the same order.
Is the run a loop, and can I stop it?
No. Start redirect runs once: five beats of 700 ms, one step each, and the timer stops by itself after the last. Cancel stops it at once and returns to the start; the Step button does one step with no timer at all, for keyboard and screen reader users who want to read each one. When all five are done the button says Start again.
What do the five steps mean?
The service provider (this page) builds a request; the browser is sent to the identity provider with it; the person signs in there, by the provider's rules, with whatever second factor it demands; the provider posts a signed assertion back to the service provider's assertion consumer URL; and the service provider checks the signature and opens its own session. The Now at line follows: the sign-in page, the provider's address, the assertion consumer URL, then the home page.
What is the typed request, and why is it code?
It is the AuthnRequest the page would send: an ID, the issue time, the provider's destination, the assertion consumer URL, the binding for the answer and the issuer, which is the entity ID above. The disclosure opens it in a box that scrolls sideways and keeps its own direction in any language. All the addresses end in .example; none is real.
What changes on a phone?
The steps sit above the facts, the descriptions under each step become screen reader text, the buttons stack under the steps so the main one is on the first screen, and the facts are trimmed to the entity ID, the assertion consumer URL and the provider. The steps, the buttons and the status are the same controls at every width.
Why is the main button quiet while the run goes?
Pressing Start redirect again would restart a run that is already going, so while it goes the button reads "Redirecting…" in a quiet style and ignores presses, but it is never disabled, so focus stays on it and nobody is stranded. Step and Cancel are quiet in the same way when they have nothing to do, and say why when pressed.
Related
- Pro
Enterprise SSO Login
SSO and providersA sign-in page for a construction project manager that asks for the workspace address first: it looks the workspace up as you type, offers the right spelling for a typo and turns the button into Continue with SSO.
- Pro
Federated Identity Login
SSO and providersA provider chooser for a cloud console: a table of five identity providers with protocol, a health word and dot, and the last check, where a provider in maintenance can't be chosen and says why, and one button connects.
- Pro
Domain Routing Login
SSO and providersA sign-in page for workforce scheduling that reads the domain of your email and says how that company signs in: one required provider, a provider with a password option, a choice of two, or a password for a stranger.
- Pro
SAML Setup Settings
Sign-in and securityA SAML single sign-on setup sheet shown open over a drawn security page: copy two values, paste the provider's metadata and see what is found (including the certificate's end day read from the certificate), run a local test, then enforce.
- Pro
OAuth Consent Login
Sign-up and consentA consent screen for a calendar when a scheduling app asks for access: two required permissions shown locked, two optional ones you can untick, a button that counts what it grants and a scope details disclosure.
- Pro
Identity Provider Login
SSO and providersA searchable list of ten sign-in providers in three groups with counts and a Connected before marker: typing filters, Enter or a press chooses, the button names the choice and shows where a real sign-in would go.