[GH-ISSUE #606] WebView not redirecting properly #394

Closed
opened 2026-03-03 16:48:20 +03:00 by kerem · 1 comment
Owner

Originally created by @TannerJuby1 on GitHub (Jun 24, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/606

Description:

OAuth Provider? (Twitter, Github, ..):

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Swift Package Manager
  • Manually

Library version:

  • head
  • v2.1.0
  • v2.0.0
  • v1.4.1
  • other: 1.2.0

Xcode version:

  • 11.4 (Swift 5.2)

  • 11.x (Swift 5.1)

  • 10.x (Swift 5.0)

  • other: 11.5

  • objective c

In my child instance of the OAuthWebViewController, I use a WKWebView to run the OAuthProcess and override the handle view controller to add some headers to the WebView. After running webview.load(request) with my auth url, it's not following the redirect...

The WebView ends up ignoring the redirect url and ends up loading these urls instead:

https://example.com/en/oauth2/authorize?destination=oauth2/authorize&client_id=<the_client_id>&redirect_uri=https://example2.com/_oauth/drupal?close&response_type=code&scope=profile%20email&state=<the_state>
https://example.com/oauth2/authorize
https://example.com/user/login?destination=oauth2/authorize
https://vars.hotjar.com/box-123blahblahblah.html

The redirect uri never ends up getting hit for some reason... Any knowledge as to why?

Originally created by @TannerJuby1 on GitHub (Jun 24, 2020). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/606 ### Description: ### OAuth Provider? (Twitter, Github, ..): ### OAuth Version: - [ ] Version 1 - [x] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Swift Package Manager - [ ] Manually ### Library version: - [ ] head - [ ] v2.1.0 - [ ] v2.0.0 - [ ] v1.4.1 - [x] other: 1.2.0 ### Xcode version: - [ ] 11.4 (Swift 5.2) - [ ] 11.x (Swift 5.1) - [ ] 10.x (Swift 5.0) - [x] other: 11.5 - [ ] objective c In my child instance of the OAuthWebViewController, I use a WKWebView to run the OAuthProcess and override the `handle` view controller to add some headers to the WebView. After running `webview.load(request)` with my auth url, it's not following the redirect... The WebView ends up ignoring the redirect url and ends up loading these urls instead: ``` https://example.com/en/oauth2/authorize?destination=oauth2/authorize&client_id=<the_client_id>&redirect_uri=https://example2.com/_oauth/drupal?close&response_type=code&scope=profile%20email&state=<the_state> https://example.com/oauth2/authorize https://example.com/user/login?destination=oauth2/authorize https://vars.hotjar.com/box-123blahblahblah.html ``` The redirect uri never ends up getting hit for some reason... Any knowledge as to why?
kerem closed this issue 2026-03-03 16:48:20 +03:00
Author
Owner

@TannerJuby1 commented on GitHub (Jun 25, 2020):

App Transport Security Issue

<!-- gh-comment-id:649721774 --> @TannerJuby1 commented on GitHub (Jun 25, 2020): App Transport Security Issue
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#394
No description provided.