You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swift toolkit that lets you communicate efficiently with many of the [Auth0 API](https://auth0.com/docs/api/info) functions and enables you to seamlessly integrate the Auth0 login.
12
11
13
12
## Important Notices
14
-
-[Behaviour changes in iOS 13](https://github.com/auth0/Auth0.swift/pull/297) related to Web Authentication require that developers using Xcode 11 with this library **must** compile using Swift 5.x. This *should* be the default setting applied when updating, unless it has been manually set. However, we recommend checking that this value is set correctly.
13
+
[Behaviour changes in iOS 13](https://github.com/auth0/Auth0.swift/pull/297) related to Web Authentication require that developers using Xcode 11 with this library **must** compile using Swift 5.x. This *should* be the default setting applied when updating, unless it has been manually set. However, we recommend checking that this value is set correctly.
15
14
16
15
## Table of Contents
17
16
@@ -38,7 +37,7 @@ Swift toolkit that lets you communicate efficiently with many of the [Auth0 API]
38
37
If you are using [Cocoapods](https://cocoapods.org), add this line to your `Podfile`:
39
38
40
39
```ruby
41
-
pod 'Auth0', '~> 1.29'
40
+
pod 'Auth0', '~> 1.30'
42
41
```
43
42
44
43
Then run `pod install`.
@@ -50,7 +49,7 @@ Then run `pod install`.
50
49
If you are using [Carthage](https://github.com/Carthage/Carthage), add the following line to your `Cartfile`:
51
50
52
51
```ruby
53
-
github "auth0/Auth0.swift"~>1.29
52
+
github "auth0/Auth0.swift"~>1.30
54
53
```
55
54
56
55
Then run `carthage bootstrap`.
@@ -73,9 +72,6 @@ Then press **Next** and complete the remaining steps.
73
72
74
73
> For further reference on SPM, check [its official documentation](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).
75
74
76
-
> ### Upgrade Notes
77
-
> If you are using the [clearSession](https://github.com/auth0/Auth0.swift/blob/master/Auth0/WebAuthenticatable.swift#L251) method in iOS 11+, you will need to ensure that the **Callback URL** has been added to the **Allowed Logout URLs** section of your application in the [Auth0 Dashboard](https://manage.auth0.com/#/applications/).
78
-
79
75
## Getting Started
80
76
81
77
### Authentication with Universal Login (iOS / macOS 10.15+)
@@ -100,7 +96,7 @@ Auth0
100
96
}
101
97
```
102
98
103
-
> This snippet sets the `audience` to ensure OIDC compliant responses, this can also be achieved by enabling the **OIDC Conformant** switch in your Auth0 dashboard under `Application / Settings / Advanced / OAuth`. For more information please check the [OIDC Conformant Authentication Adoption Guide](https://auth0.com/docs/api-auth/tutorials/adoption).
99
+
> This snippet sets the `audience` to ensure OIDC compliant responses, this can also be achieved by enabling the **OIDC Conformant** switch in your Auth0 dashboard under `Application / Settings / Advanced / OAuth`.
104
100
105
101
3. Allow Auth0 to handle authentication callbacks. In your `AppDelegate.swift`, add the following:
106
102
@@ -128,7 +124,7 @@ In order to use Auth0 you need to provide your Auth0 **ClientId** and **Domain**
128
124
129
125
#### Adding Auth0 Credentials
130
126
131
-
In your application bundle add a `plist` file named `Auth0.plist` with the following information.
127
+
In your application bundle add a `plist` file named `Auth0.plist` with the following information:
132
128
133
129
```xml
134
130
<?xml version="1.0" encoding="UTF-8"?>
@@ -143,11 +139,21 @@ In your application bundle add a `plist` file named `Auth0.plist` with the follo
143
139
</plist>
144
140
```
145
141
142
+
As an alternative, you can pass the ClientId & Domain programmatically.
Callback URLs are the URLs that Auth0 invokes after the authentication process. Auth0 routes your application back to this URL and appends additional parameters to it, including a token. Since callback URLs can be manipulated, you will need to add your callback URL to the **Allowed Callback URLs** field in the [Auth0 Dashboard](https://manage.auth0.com/#/applications/). This will enable Auth0 to recognize these URLs as valid. If omitted, authentication will not be successful.
149
155
150
-
In your application's `Info.plist` file, register your iOS / macOS Bundle Identifer as a custom scheme:
156
+
In your application's `Info.plist` file, register your iOS / macOS Bundle Identifer as a custom scheme.
151
157
152
158
```xml
153
159
<!-- Info.plist -->
@@ -207,7 +213,7 @@ Auth0
207
213
208
214
#### Renew user credentials
209
215
210
-
Use a [Refresh Token](https://auth0.com/docs/tokens/concepts/refresh-tokens) to renew user credentials. It's recommended that you read and understand the refresh token process before implementing.
216
+
Use a [Refresh Token](https://auth0.com/docs/tokens/refresh-tokens) to renew user credentials. It's recommended that you read and understand the refresh token process before implementing.
211
217
212
218
```swift
213
219
Auth0
@@ -273,7 +279,7 @@ credentialsManager.credentials { error, credentials in
273
279
274
280
#### Clearing credentials and revoking refresh tokens
275
281
276
-
Credentials can be cleared by using the `clear` function, which clears credentials from the Keychain:
282
+
Credentials can be cleared by using the `clear` function, which clears credentials from the Keychain.
277
283
278
284
```swift
279
285
let didClear = credentialsManager.clear()
@@ -344,7 +350,7 @@ Find out more about [Setting up Facebook Login](https://auth0.com/docs/connectio
344
350
### Authentication API (iOS / macOS / tvOS)
345
351
346
352
The Authentication API exposes AuthN/AuthZ functionality of Auth0, as well as the supported identity protocols like OpenID Connect, OAuth 2.0, and SAML.
347
-
We recommend using [Universal Login](https://auth0.com/docs/universal-login) but if you wish to build your own UI, you can use our API endpoints to do so. However, some Auth flows (grant types) are disabled by default so you must enable them via your Auth0 Dashboard as explained in [Application Grant Types](https://auth0.com/docs/applications/concepts/application-grant-types#edit-available-grant_types).
353
+
We recommend using [Universal Login](https://auth0.com/docs/universal-login) but if you wish to build your own UI, you can use our API endpoints to do so. However, some Auth flows (grant types) are disabled by default so you must enable them via your Auth0 Dashboard as explained in [Update Grant Types](https://auth0.com/docs/applications/update-grant-types).
348
354
349
355
These are the required Grant Types that needs to be enabled in your application:
350
356
@@ -355,11 +361,10 @@ These are the required Grant Types that needs to be enabled in your application:
Users of Auth0 Private Cloud with Custom Domains still on the [legacy behavior](https://auth0.com/docs/private-cloud/private-cloud-migrations/migrate-private-cloud-custom-domains#background) need to specify a custom issuer to match the Auth0 domain before starting the authentication. Otherwise, the ID Token validation will fail.
428
+
Users of Auth0 Private Cloud with Custom Domains still on the [legacy behavior](https://auth0.com/docs/private-cloud/private-cloud-migrations/migrate-private-cloud-custom-domains) need to specify a custom issuer to match the Auth0 domain before starting the authentication. Otherwise, the ID Token validation will fail.
If you are using the [Bot Protection](https://auth0.com/docs/anomaly-detection/bot-protection) feature and performing database login/signup via the Authentication API, you need to handle the `isVerificationRequired` error. It indicates that the request was flagged as suspicious and an additional verification step is necessary to log the user in. That verification step is web-based, so you need to use Universal Login to complete it.
434
+
If you are using the [Bot Detection](https://auth0.com/docs/anomaly-detection/bot-detection) feature and performing database login/signup via the Authentication API, you need to handle the `isVerificationRequired` error. It indicates that the request was flagged as suspicious and an additional verification step is necessary to log the user in. That verification step is web-based, so you need to use Universal Login to complete it.
@@ -437,11 +440,10 @@ let scope = "openid profile"
437
440
438
441
Auth0
439
442
.authentication()
440
-
.login(
441
-
usernameOrEmail: email,
442
-
password: "secret-password",
443
-
realm: realm,
444
-
scope: scope)
443
+
.login(usernameOrEmail: email,
444
+
password: "secret-password",
445
+
realm: realm,
446
+
scope: scope)
445
447
.start { result in
446
448
switch result {
447
449
case .success(let credentials):
@@ -464,11 +466,10 @@ Auth0
464
466
}
465
467
```
466
468
467
-
In the case of signup, you can add [an additional parameter](https://auth0.com/docs/universal-login/new-experience#signup) to make the user land directly on the signup page:
469
+
In the case of signup, you can add [an additional parameter](https://auth0.com/docs/universal-login/new-experience#signup) to make the user land directly on the signup page.
Check out how to set up Universal Login in the [Getting Started](#getting-started) section.
@@ -514,8 +515,8 @@ Auth0 helps you to:
514
515
515
516
* Add authentication with [multiple sources](https://auth0.com/docs/identityproviders), either social identity providers such as **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce** (amongst others), or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS, or any SAML Identity Provider**.
516
517
* Add authentication through more traditional **[username/password databases](https://auth0.com/docs/connections/database/custom-db)**.
517
-
* Add support for **[linking different user accounts](https://auth0.com/docs/link-accounts)** with the same user.
518
-
* Support for generating signed [JSON Web Tokens](https://auth0.com/docs/tokens/concepts/jwts) to call your APIs and **flow the user identity** securely.
518
+
* Add support for **[linking different user accounts](https://auth0.com/docs/users/user-account-linking)** with the same user.
519
+
* Support for generating signed [JSON Web Tokens](https://auth0.com/docs/tokens/json-web-tokens) to call your APIs and **flow the user identity** securely.
519
520
* Analytics of how, when, and where users are logging in.
520
521
* Pull data from other sources and add it to the user profile through [JavaScript rules](https://auth0.com/docs/rules).
521
522
@@ -535,6 +536,3 @@ If you have found a bug or to request a feature, please [raise an issue](https:/
535
536
## License
536
537
537
538
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
0 commit comments