Add a SAML v2 IdP-Initiated IdP
On this page
This feature requires at least a Starter plan.
1.26.0
Let users log in to an Application from a dashboard in a SAML v2 Identity Provider (IdP), such as a tile in Okta. The SAML v2 IdP Initiated Identity Provider accepts a SAML response that the IdP sends without a request from FusionAuth.
FusionAuth doesn't recommend IdP-initiated login. For the risks, see SAML v2 IdP-Initiated Login.
When the IdP also supports SP-initiated login, use a SAML v2 Identity Provider with Enable IdP initiated login instead. The SAML v2 Identity Provider supports both types of login with one configuration, in FusionAuth 1.43.0 and later.
For the steps with Okta, see Configure SAML v2 IdP-Initiated SSO for Okta.
Prerequisites#
- A FusionAuth plan that includes IdP-initiated login.
- Permission to create an application in the SAML v2 Identity Provider.
- The EntityId and the signing certificate of the SAML v2 Identity Provider.
- An Application in FusionAuth for users to log in to.
Import the Signing Certificate#
-
In the Admin UI, navigate to Settings -> Key Master .
-
At the top of the page, open the drop-down menu of key actions, and select Import certificate .
-
Enter a Name, and paste the PEM encoded certificate into Certificate.
-
Click Submit .
For more information, see Import Certificate.
Create the Identity Provider#
-
Navigate to Settings -> Identity Providers . Click the arrow next to the add button, and select SAML v2 IdP Initiated .
-
Select the Tenant for the Identity Provider, or select
Global identity provider. You can't change the scope later. For more information, see Identity Provider Scope. -
Set Issuer to the EntityId of the SAML v2 Identity Provider.
-
Add the imported certificate to Verification keys.
-
On the Options tab, set Email claim to the name of the email attribute in the SAML response. When the
NameIDholds the email address, turn on Use NameId for email instead. -
On the Applications tab, turn on Enabled for each Application that users log in to from the IdP. To register new users for the Application, turn on Create registration.
-
Click .
For a description of each field, see Form Fields.
Set the Redirect URL#
After login, FusionAuth sends the user to a URL in Authorized redirect URLs of the Application. To add the URL:
-
Navigate to Applications , and click next to the Application.
-
On the OAuth tab, add the URL that users land on after login to Authorized redirect URLs.
-
Click .
Configure the SAML v2 Identity Provider#
-
In the FusionAuth Admin UI, navigate to Settings -> Identity Providers , and click next to the Identity Provider.

-
In the SAML v2 Integration details section, find the Application in IdP Initiated Callback URLs (ACS), and copy the URL.

-
In the SAML v2 Identity Provider, set the ACS URL, sometimes called the single sign-on URL, to the copied URL. To get a refresh token, add
?scope=offline_accessto the URL. -
In the SAML v2 Identity Provider, set the Audience, sometimes called the SP EntityId, to Issuer from the Integration Details.
-
In the SAML v2 Identity Provider, set
RelayStateto the URL from Authorized redirect URLs. When you leave outRelayState, FusionAuth uses the first URL in Authorized redirect URLs.
For the rules that FusionAuth applies to the redirect URI and scope, see SAML v2 IdP-Initiated Login.
Configure CORS#
The Identity Provider sends the SAML response to FusionAuth in an HTTP POST request from the origin of the Identity Provider. When the CORSA browser security mechanism that lets a web page request restricted resources from another domain when the server allows the request. filter is enabled and doesn't allow both the origin and the POST method, FusionAuth rejects the request with a 403 status code. To allow the request:
-
Navigate to Settings -> System -> CORS .
-
Add the scheme and host of the Identity Provider, such as
https://login.example.com, to Allowed origins. -
In Allowed methods, select
POST. -
Click .
For more information, see the CORS Filter reference.
Test the Login#
Open a private browser window, log in to the SAML v2 Identity Provider, and open the FusionAuth application from the IdP dashboard. FusionAuth redirects you to the redirect URL with an authorization code. Your application then exchanges the code for tokens at the Token endpoint.
Troubleshooting#
To troubleshoot a SAML flow, turn on Enable debug logging on the Identity Provider, and complete the SAML flow. Then navigate to System -> Event Log , and review the entries for configuration issues. Turn off debug logging when you finish.
The following errors are common:
- When the Event Log contains
Invalid SAML v2.0 operation. The signature is invalid., the Identity Provider signed the response with a certificate that isn't in Verification keys. To find the certificate, turn on debug logging, and repeat the login. The debug entry in the Event Log contains the raw SAML response. Compare theX509Certificatevalue in the response with the certificates in Verification keys. Import the missing certificate, and add the certificate to Verification keys. For more information, see SAML v2 Signature Verification. - When the login page shows
The SAML audience failed validation., the Audience in the Identity Provider doesn't match Issuer in the Integration Details. With debug logging on, the Event Log shows the expected Audience. - When the browser network console shows a
403status code for thePOSTto the ACS URL, the CORS configuration doesn't allow the request. For the fix, see Configure CORS. - During an IdP-initiated login, an error page with
invalid_redirect_urimeans thatRelayStatedoesn't match a URL in Authorized redirect URLs. - During an IdP-initiated login, the message
The request origin could not be verified.means that FusionAuth didn't treat the request as an IdP-initiated login. Check that the ACS URL contains the Id of the Identity Provider and the Client Id of the Application. Check that the Identity Provider is enabled for the Application.
Related
Learn how FusionAuth handles a SAML v2 IdP-initiated login, and how FusionAuth chooses the redirect URI and scope.
Configure SAML v2 for Active Directory Federation Services (ADFS).
Learn how to configure Azure AD (Microsoft Entra ID) as a SAML v2 Identity Provider for FusionAuth.
Learn how to let users log in to FusionAuth from the Okta dashboard with SAML v2 IdP-initiated login.