Auth0js - login without redirect

I use Auth0JS for authentication: https://auth0.com/docs/libraries/auth0js/v9

The signup is very simple and looks like this:

auth.signup({ email: 'some-email', password: 'some-password' })

The log-in looks like this:

auth.login({ email: 'some-email', password: 'some-password' })

However, when I call login method, I immediately get redirected to Auth0 page just to confirm…

Is it possible to log-in without doing the redirect? I can’t find any information about it in the docs for auth0js…

1 Like

I’ve noticed that there is actually a auth.client.login() method that is supposed to log in without the redirection part.

So the call looks like this:

auth.client.login({ email: 'some-email', password: 'some-password', realm: 'Username-Password-Authentication'  })

Unfortunately when using this method, I get 401 status

error: "access_denied"
error_description: "Unauthorized"

This is super weird… I am doing the call from the browser. Am I supposed to do it through the server?

I use webAuth.popup.loginWithCredentials(options, (error, data) =>{})
‘popup’… super weird, but it don’t open a popup at modern browsers (incl. IE11). it generates a hidden iFrame.

Hey there!

Sorry for such huge delay in response! We’re doing our best in providing you with best developer support experience out there, but sometimes our bandwidth is not enough comparing to the number of incoming questions.

Wanted to reach out to know if you still require further assistance?