Auth0 as Identity Provider Where IdP Initiates SSO

I’m following the documentation here:

Its not clear how I would use auth0 Lock to assemble the specified URL

We’ve tried various iterations of the following:

<script src=""></script>
<script type="text/javascript">
      var lock = new Auth0Lock('CLIENT_ID', '', {
            samlp: true,
            auth: {
              params: {
                responseType: 'token',
                RelayState: http://FINAL_DESTINATION_URL

      function signin() {;

we get the following Error when using the default Lock config:
Failed to load The value of the ‘Access-Control-Allow-Credentials’ header in the response is ‘’ which must be ‘true’ when the request’s credentials mode is ‘include’. Origin ‘’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

If you have configured Auth0 to act as a SAML identity provider and then you want to perform a IdP initiated login then there is no need to bring Lock as a dependency, to my knowledge, there’s not even support in Lock for that.

In conclusion, for an IdP initiated login unless I’m missing something you just need to navigate the user to the URL you got from the documentation you linked to, in particular, you’ll have:



  • [your_account] - is your Auth0 account;
  • [your_client_id] - is the client identifier that you created to represent the SAML service provider for which you want to trigger the IdP initiated login;
  • [the_desired_final_url_at_the_sp] - is the encoded URL to which you would want the service provider to navigate the user after receiving and validating the authentication; have in mind that the service provider needs to play along and process the RelayState in this way.
1 Like