The simple tutorial: An error occurred when fetching client data for Lock

Hi there,
I am trying to follow the tutorial: Test SAML SSO with Auth0 as Service Provider and Identity Provider
step by step.
All goes fine.
Unfortunately, the last step, when I open the simple HTML app,
The login button could not work.


<p> Click on the button to log in </p>

<script src=""></script>
<script type="text/javascript">
  var lock = new Auth0Lock('vgRH8Hb3bBt94320kT1WIe7TrqgINyk5', '',{
        auth: {
          redirectUrl: '',
          audience: '',
          responseType: 'token',
          params: {scope: 'openid'}

  function signin() {;
<button onclick="signin()">Login</button>

The error caught by Chrome:
index.js:493 Uncaught Error: Error: An error occurred when fetching client data for Lock: could not be loaded.
at index.js:493:7

I have read all the similar topics online. I have checked the client ID and domain are exactly the same. No extensions are used in the browser. Tried with Chrome, firefox and IE. ALL the same result.

I have followed every steps in the provided tutorial.
You see, it’s so simple steps in the tutorial so I can make sure I exactly follow every steps.

Can any one kindly give me some hint?
I appreciate any help!

Hi @rui.liu2

Welcome to the Auth0 Community.

The only way I can reproduce your issue is by inserting an incorrect client id. You said you have checked this and it is correct. Perhaps the audience is causing an issue? can you try using the management api for an audience and see if this works just for testing against a valid api https://YOUR-DOMAIN/api/v2/

Warm regards.

Hi SaqibHussain,

Thanks a lot for your kind reply.

Unfortunately it doesn’t work for me. I changed the audience in the html file, with replacing YOUR-DOMAIN with my real domain name.

  1. I am sure the client ID is the same:
    the ID shown in the error message:
    vgRH8Hb3bBt94320kT1WIe7TrqgINyk5.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    index.js:493 Uncaught Error: Error: An error occurred when fetching client data for Lock: could not be loaded.
  • at index.js:493:7*

and compare with: copy from the auth0 board: vgRH8Hb3bBt94320kT1WIe7TrqgINyk5

  1. I have also tried to put the html file in localhost, as another tutorial mentions that it should not be opened directly from my disk.

  2. I tired to only use auth0 as an IDP and use samltest tool as a server, it works.

Thanks again for your help.

Hi @rui.liu2

Please can you try to update Lock to the latest patch level:

<script src=""></script>

Warm regards.


Thanks very much!
This solves that error!


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.