You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set up automated Playwright tests with a next application using next-auth 4 with Keycloak as a provider. The tests will mock all responses from API's, and I I'm looking into mocking the authenticated state as well. I've done something similar with a Vite application using Okta in the past, following the approach outlined in this article, where you set a few Okta specific cookies and mock an endpoint returning the user info.
I've been trying to achieve the same with next-auth and Keycloak, but I'm questioning whether I'm even able to achieve something like this, or if I should look into adding a test user to our Keycloak instance, and perform a 'real' login in our tests with that user. Would hugely appreciate input from anyone that have looked into a similar usecase! 🙇
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
I'm trying to set up automated Playwright tests with a next application using next-auth 4 with Keycloak as a provider. The tests will mock all responses from API's, and I I'm looking into mocking the authenticated state as well. I've done something similar with a Vite application using Okta in the past, following the approach outlined in this article, where you set a few Okta specific cookies and mock an endpoint returning the user info.
I've been trying to achieve the same with next-auth and Keycloak, but I'm questioning whether I'm even able to achieve something like this, or if I should look into adding a test user to our Keycloak instance, and perform a 'real' login in our tests with that user. Would hugely appreciate input from anyone that have looked into a similar usecase! 🙇
Kindest regards
Jens
Beta Was this translation helpful? Give feedback.
All reactions