Rayrun
← Back to Discord Forum

auth0 authentication

I am trying to do something similar to cypress with https://docs.cypress.io/guides/end-to-end-testing/auth0-authentication#Programmatic-Login

I am however not able to set the cookie or the id_token and it always ends up showing unauthorized. I have double chekced all the client ids, secrets and they appear fine.

Has anyone implemented Auth0 with playwright? I ended up with setting up auth-setup however, I wanted to know if this login is possible?

This thread is trying to answer question "Has anyone implemented Auth0 with Playwright and how to set up authentication correctly?"

4 replies
artembondar_
artembondar_

I was trying to figure this out, and ended up with this solution. Not perfect, as initial run requires to run browser (headlessly), but the rest steps are sharing the authenticated state. Also bearer token saved to ENV variable to use for API requests if needed

This documentation might help you either create setup project and make it as dependency for the test or you make it as fixture and it will prepare your cookies before tests https://playwright.dev/docs/auth

Deleted User

Yup. I ended up using the browser too. Made the auth-setup as dependency for the suite

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].