openid / openid/AppAuth-iOS

Feature Request : option to skip check on redirect URI

Open
#890 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Objective-C
Stars
2k
Forks
867
Avg merge
4d 48m
Merged PRs (30d)
1

Description

My use case

I have a current use case where the redirect_uri I provide is not the same URI I actually use. This is the setup:

  • My App has the custom URL scheme "app://"
  • My Identity provider needs to redirect to "https://www.foo.com", so I set that value as redirect_uri
  • "http://www.foo.com" serves as a proxy and redirects back to "app://"
App --> Identity Provider --> https://www.foo.com --> app://

But: in OIDAuthorizationService::mresumeExternalUserAgentFlowWithURL there is a check in shouldHandleURL that validates if the URI that came back to the App matches with that I have set for redirect_uri in my initial request.

Now my authentication flow is not finishing.

The solution I'd like

It would be nice if there was some kind of configuration option that would allow me to ignore this additional check. For as far as I can tell from the comments, the check is done to "reject URLs that don't match redirect (these may be completely unrelated to the authorization)".

Alternatives I've considered

I've considered the following:

  • Create a fork of the repo and only comment out that one line.
  • Don't use "app://" but Apple's Universal Links, but my client cannot support that (yet?).
  • Create a patch file of this change and patch the checked out source code in my build phase (this is what I do now).

Additional context

I'm not sure if skipping this check is against the specs or if this introduces a security risk, but I guess if you have a MITM attack the redirect_uri cannot be trusted anyways.

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 in OIDAuthorizationService::mresumeExternalUserAgentFlowWithURL and inspect the shouldHandleURL check described in the issue. Determine whether an option to bypass redirect URI validation is compatible with OAuth security expectations, then define what configuration and flow behavior would be required for the reported proxy setup to complete successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
authentication, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.