Skip to content

Commit f544bc3

Browse files
committed
Update Swift Package platform support & README.md
1 parent c48aba2 commit f544bc3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import PackageDescription
2424
let package = Package(
2525
name: "OAuth2",
2626
platforms: [
27-
.macOS(.v10_11), .iOS(.v8), .tvOS(.v9), .watchOS(.v3)
27+
.macOS(.v10_13), .iOS(.v12), .tvOS(.v12), .watchOS(.v5)
2828
],
2929
products: [
3030
.library(name: "OAuth2", targets: ["OAuth2"]),

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ See those `redirect_uris`?
5555
You can use the scheme you want, but you must **a)** declare the scheme you use in your `Info.plist` and **b)** register the very same URI on the authorization server you connect to.
5656

5757
Note that **as of iOS 9**, you _should_ use [Universal Links](https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html) as your redirect URL, rather than a custom app scheme.
58-
This prevents others from re-using your URI scheme and intercept the authorization flow.
58+
This prevents others from re-using your URI scheme and intercept the authorization flow.
59+
If you **target iOS 12 and newer** you should be using `ASWebAuthenticationSession`, which makes using your own local redirect scheme secure.
5960

6061
Want to avoid switching to Safari and pop up a SafariViewController or NSPanel?
6162
Set this:
@@ -142,7 +143,7 @@ If you want to dig deeper or do authorization yourself, here it goes:
142143
### 4. Manually Authorize the User
143144

144145
By default the OS browser will be used for authorization if there is no access token present or in the keychain.
145-
**Starting with iOS 9**, `SFSafariViewController` will be used when enabling embedded authorization on iOS.
146+
**Starting with iOS 12**, `ASWebAuthenticationSession` will be used when enabling embedded authorization on iOS (previously, starting with iOS 9, `SFSafariViewController` was used instead).
146147

147148
To start authorization call **`authorize(params:callback:)`** or, to use embedded authorization, the convenience method `authorizeEmbedded(from:callback:)`.
148149

@@ -409,7 +410,7 @@ Starting after version 4.2, on iOS 11 (`SFAuthenticationSession`) and iOS 12 (`A
409410

410411
oauth2.authConfig.ui.useAuthenticationSession = true
411412

412-
To revert to the old custom `OAuth2WebViewController`:
413+
To revert to the old custom `OAuth2WebViewController`, which you _should not do_ because `ASWebAuthenticationSession` is way more secure:
413414

414415
oauth2.authConfig.ui.useSafariView = false
415416

0 commit comments

Comments
 (0)