openid / openid/AppAuth-JS

Support Non-Hash Auth Code Redirects

Open
#211 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

I can handled an auth code redirect with a query string, not just a hash.

[REQUIRED] Describe expected behavior

When I call completeAuthorizationRequestIfPossible i'd like it to look at the query string if some configuration option is set.

This line: https://github.com/openid/AppAuth-JS/blob/c30f85e490ab41c9f1e8f8ee05bfdfe964e08626/src/redirect_based_handler.ts#L100 it'd be cool if could handle query strings or hashes.

Describe the problem

See above. My oauth server returns query strings, not hashes. Would like to be able to use this library in browser.

[REQUIRED] Actual Behavior

Second half of the oauth flow never completes, since the code, state, etc, are all in the query string, not hash.

[REQUIRED] Steps to reproduce the behavior

Use an oauth server that sends back an auth code response in a query string.

[REQUIRED] Environment
  • AppAuth-JS version: 1.3.1
  • AppAuth-JS Environment (Node, Browser (UserAgent), ...):Browser
  • 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 src/redirect_based_handler.ts around the referenced completeAuthorizationRequestIfPossible call. Trace how browser redirects currently read the hash and determine how the requested configuration option should select query-string handling. Done means an OAuth authorization-code redirect carrying code and state in the query string completes the flow as well as the existing hash form.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.