Authenticate test users for integration testing implicit grant

My Problem: I have been unable to find an endpoint that allows me to programmatically log a user in under implicit grant.

My Context: I need to test that an endpoint only allows one user to checkout a resource at a time. So within my test I need two users logged in.

I realize that this is probably intentional as that is the point of implicit grant and the solution around it, but I am wondering how I am supposed to perform integration tests over my controller endpoints?

1 Like

Welcome to Auth0 Community @jwootonn

I don’t have an answer for you. However I do have a suggestion. checkout this blog which talks about using Cypress to do end to end testing for a SPA that is protected with Auth0 authentication.

When you request the tokens on login make sure you are using your own api identifier instead of Auth0 management api as shown in that blog. Once you have the tokens you should be able to call your own endpoint I think. Also please note that as the blog suggest, do not use and enable password grant for your production app. Hope this helps.