[GH-ISSUE #630] OAuth unable to get the accesstoken on iOS 14 #412

Closed
opened 2026-03-03 16:48:29 +03:00 by kerem · 3 comments
Owner

Originally created by @FDavidse20 on GitHub (Oct 27, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/630

Description:

We have implemented the flow that loggin in our iOS app opens SFSafariViewController which displays the login page handled by our own identity server. The user logs in, is redirected back to the app, and there the necessary calls our made to get the tokens we need.
This is working fine up until iOS 13.
When trying on iOS14, building with Xcode 12, the logging in and redirecting back is working as expected. But
when the OAuthSwift framework tries to get the access token in the function
fileprivate func requestOAuthAccessToken(..)

it fails, because it encounters an error, 403 Forbidden.
Any ideas what kind of differences between Xcode 12/iOS 14 and Xcode 11/iOS 13 could be causing this?

Thank you.

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

our own

OAuth Version:

  • Version 1
  • [x ] 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: (Please fill in the version you are using.)

Xcode version:

  • 11.4 (Swift 5.2)

  • 11.x (Swift 5.1)

  • 10.x (Swift 5.0)

  • other: (Please fill in the version you are using.)

  • objective c

Originally created by @FDavidse20 on GitHub (Oct 27, 2020). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/630 ### Description: We have implemented the flow that loggin in our iOS app opens SFSafariViewController which displays the login page handled by our own identity server. The user logs in, is redirected back to the app, and there the necessary calls our made to get the tokens we need. This is working fine up until iOS 13. When trying on iOS14, building with Xcode 12, the logging in and redirecting back is working as expected. But when the OAuthSwift framework tries to get the access token in the function fileprivate func requestOAuthAccessToken(..) it fails, because it encounters an error, 403 Forbidden. Any ideas what kind of differences between Xcode 12/iOS 14 and Xcode 11/iOS 13 could be causing this? Thank you. ### OAuth Provider? (Twitter, Github, ..): our own ### 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 - [x] v2.0.0 - [ ] v1.4.1 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [ ] 11.4 (Swift 5.2) - [ ] 11.x (Swift 5.1) - [ ] 10.x (Swift 5.0) - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem closed this issue 2026-03-03 16:48:29 +03:00
Author
Owner

@Yudi26 commented on GitHub (Oct 30, 2020):

Using this I am able to get access token in Xcode 13, ios 14. Please try this.
self.oauthswift?.client.credential.oauthToken

<!-- gh-comment-id:719421861 --> @Yudi26 commented on GitHub (Oct 30, 2020): Using this I am able to get **access token** in Xcode 13, ios 14. Please try this. `self.oauthswift?.client.credential.oauthToken`
Author
Owner

@phimage commented on GitHub (Nov 10, 2020):

no idea

<!-- gh-comment-id:724439149 --> @phimage commented on GitHub (Nov 10, 2020): no idea
Author
Owner

@FDavidse20 commented on GitHub (Nov 10, 2020):

Thank you for your answers. However I'm not able to reproduce the issue anymore reliably.

<!-- gh-comment-id:724543813 --> @FDavidse20 commented on GitHub (Nov 10, 2020): Thank you for your answers. However I'm not able to reproduce the issue anymore reliably.
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#412
No description provided.