Programmatically Login through Lock

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: cypress - Programmatically authenticate in Auth0 - Stack Overflow. Am I doing this wrong? Is there a better way to do this?

1 Like

If you want to programmatically login, use our javascript SDK

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.

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

2 Likes

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