Auth0 Home Blog Docs

Programmatically Login through Lock

login

#1

I’m using cypress.io for UI testing and I wanted to programmatically login to avoid testing the Auth0 login. I’m trying to POSST to /usernamepassword/login and then /login/callback. I have a stackoverflow explaining it here: https://stackoverflow.com/questions/50135217/programmatically-authenticate-in-auth0. Am I doing this wrong? Is there a better way to do this?


#2

If you want to programmatically login, use our javascript SDK


#3

But doesn’t that still just use the lock which you would have to manually fill out the username and password? The client.login uses the Resource Owner Password Grant which my app is not using.


#4

you want to bypass lock, right? so use webauth.login and you’ll get redirected to the callback page with the access_token etc.


#5

Ahh, I completely missed the full docs link. I think this will work. Thank you so much.