openid / openid/AppAuth-JS

Unable to catch state mismatch error

Open
#207 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1k
Forks
165
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

[REQUIRED] Describe expected behavior

When calling completeAuthorizationRequestIfPossible I would like to be able to catch the error where the current request state mismatches the returned state. There is already an error response in the notifier that could easily be used for this, and resolving completeAuthorizationRequest with {request, null, error} would solve this issue.

Describe the problem

[REQUIRED] Actual Behavior

When calling completeAuthorizationRequestIfPossible and the state is mismatched, there is a console log that this happened but no way to actually act on this outcome.

[REQUIRED] Steps to reproduce the behavior

In my implementation this issue came up when a user had multiple tabs open and they tried to sign in to each of the tabs. This caused the tabs that are mismatched to be stuck. To replicate the issue simple attempt a login with your favorite provider but before submitting the login change the current appauth_current_authorization_request to something else. This will log Mismatched request (state and request_uri) dont match. but nothing else happens.

[REQUIRED] Environment
  • AppAuth-JS version: 1.3.1
  • AppAuth-JS Environment (Node, Browser (UserAgent), ...): Latest Chrome
  • Source code snippts (inline or JSBin)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at completeAuthorizationRequestIfPossible and trace its call to completeAuthorizationRequest and the notifier's existing error response. Verify the mismatched-state path gives callers a way to handle the outcome, including the request and error, and confirm the behavior for the multiple-tab scenario described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.