Failed Silent Auth : login failed error while try to do silent authentication for API

I am trying to call getTokenSilently$ using HTML intercept and get token in responses before making actual call to my APIs. Calling I am initiating from Angular APP and API is in Node.

When checked logs in auth0 it says ‘failed silen auth’

not sure where I am making mistake. Could you please help its urgent?

Logs as attached
auth0.txt (2.7 KB)

Thanks,
Denish

Hi Denish,

In the log file you shared you can see the login_required error returned. This is a normal error that occurs when the user is not logged in with Auth0.

Silent authentication works by making a request to Auth0 in the background. If the user has logged in previously, Auth0 will use their session to issue a new token without prompting the user to enter their credentials.

The session expires after a certain period of inactivity (meaning no interaction with Auth0) as well as after a certain time period regardless of activity. You can configure the expiry times with the Inactivity timeout and Require login after settings respectively as explained here: https://auth0.com/docs/dashboard/guides/tenants/configure-session-lifetime-settings

You should handle the login_required (and other error responses) by redirecting the user to the universal login page without prompt=none in the URL parameters.

Please read through the following article. It will help you understand the error responses from silent authentication in more detail: https://auth0.com/docs/api-auth/tutorials/silent-authentication#error-response: