I have:
- Duende IdentityServer
- Asp.Net Web App (Using BFF Framework)
I would like to run a Cypress end to end test on the web app, which is protected by a login page using an Authorization Code Flow via my IdentityServer.
My understanding is that Cypress is not able to navigate away to an external page and back again, so mocking the authorization code flow is not possible. Instead, I have seen example of how auth0 gets around this by using a grant type of password.
Can I therefore do a similar thing and add a password grant type to my client's grant type in IdentityServer, and then have Cypress make an API request and retrieve back an ID and access token this way?
If yes, I'm unsure how to go about passing these into my application through Cypress, so that the BFF framework is able to use these the same way that it would through the original authorization code flow.
Would really appreciate if anyone has solved any of these issues, or has any suggestions - thanks.