Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to force a InteractionRequiredAuthError? For integration testing #7140

Closed
hterik opened this issue Jun 4, 2024 · 2 comments
Closed

How to force a InteractionRequiredAuthError? For integration testing #7140

hterik opened this issue Jun 4, 2024 · 2 comments
Labels
feature-unconfirmed msal-browser Related to msal-browser package msal-react Related to @azure/msal-react Needs: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@hterik
Copy link

hterik commented Jun 4, 2024

Core Library

MSAL.js (@azure/msal-browser)

Wrapper Library

MSAL React (@azure/msal-react)

Public or Confidential Client?

Public

Description

Hi
I'm in a situation where our application behaves very strange when msal throws a InteractionRequiredAuthError and application attempts to solve it with acquireTokenRedirect.
The problem is that Interaction required only happens once every few days and the whole flow becomes very difficult to troubleshoot and reproduce.

Is there any way one can force such an error? Just unit testing the scenarios is not enough, because how acquireTokenPopup/ acquireTokenRedirect behave together with the browser and interaction with Azure is also very tightly coupled.

Source

External (Customer)

@hterik hterik added feature-unconfirmed question Customer is asking for a clarification, use case or information. labels Jun 4, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Jun 4, 2024
@github-actions github-actions bot added msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications labels Jun 4, 2024
@tnorling
Copy link
Collaborator

tnorling commented Jun 4, 2024

If you're testing manually you can delete the refresh token from local/session storage and set CacheLookupPolicy to "RefreshToken".

If you're attempting to write tests I recommend mocking the call.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Jun 4, 2024
Copy link
Contributor

@hterik This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.

@microsoft-github-policy-service microsoft-github-policy-service bot added the no-issue-activity Issue author has not responded in 5 days label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-unconfirmed msal-browser Related to msal-browser package msal-react Related to @azure/msal-react Needs: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

2 participants