Skip to content

Commit

Permalink
Update PKCE-related messaging (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket authored Aug 11, 2023
1 parent d621132 commit 47354dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Auth0/WebAuthError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public struct WebAuthError: Auth0Error {

/// The Auth0 application does not support authentication with Proof Key for Code Exchange (PKCE).
/// PKCE support needs to be enabled in the settings page of the [Auth0 application](https://manage.auth0.com/#/applications/),
/// by setting the **Application Type** to 'Native' and the **Token Endpoint Authentication Method** to 'None'.
/// by setting the **Application Type** to 'Native'.
/// This error does not include a ``Auth0Error/cause-9wuyi``.
public static let pkceNotAllowed: WebAuthError = .init(code: .pkceNotAllowed)

Expand Down Expand Up @@ -84,7 +84,7 @@ extension WebAuthError {
case .userCancelled: return "The user cancelled the Web Auth operation."
case .pkceNotAllowed: return "Unable to perform authentication with PKCE."
+ " Enable PKCE support in the settings page of the Auth0 application, by setting the"
+ " 'Application Type' to 'Native' and the 'Token Endpoint Authentication Method' to 'None'."
+ " 'Application Type' to 'Native'."
case .noAuthorizationCode(let values): return "The callback URL is missing the authorization code in its"
+ " query parameters (\(values))."
case .idTokenValidationFailed: return "The ID token validation performed after authentication failed."
Expand Down
2 changes: 1 addition & 1 deletion Auth0Tests/WebAuthErrorSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class WebAuthErrorSpec: QuickSpec {
it("should return message for PKCE not allowed") {
let message = "Unable to perform authentication with PKCE."
+ " Enable PKCE support in the settings page of the Auth0 application, by setting the"
+ " 'Application Type' to 'Native' and the 'Token Endpoint Authentication Method' to 'None'."
+ " 'Application Type' to 'Native'."
let error = WebAuthError(code: .pkceNotAllowed)
expect(error.localizedDescription) == message
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ Head to the [Auth0 Dashboard](https://manage.auth0.com/#/applications/) and crea

Auth0.swift needs the **Client ID** and **Domain** of the Auth0 application to communicate with Auth0. You can find these details in the settings page of your Auth0 application. If you have a [custom domain](https://auth0.com/docs/customize/custom-domains), use your custom domain instead of the value from the settings page.

> **Warning**
> Make sure that the Auth0 application type is **Native**. Otherwise, you might run into errors due to the different configuration of other application types.
#### Configure Client ID and Domain with a plist

Create a `plist` file named `Auth0.plist` in your app bundle with the following content:
Expand Down Expand Up @@ -153,9 +156,6 @@ For example, if your iOS bundle identifier was `com.example.MyApp` and your Auth
com.example.MyApp://example.us.auth0.com/ios/com.example.MyApp/callback
```

> **Note**
> Make sure that the **Token Endpoint Authentication Method** [setting](https://auth0.com/docs/get-started/applications/confidential-and-public-applications/view-application-type) is set to `None`.
#### Configure custom URL scheme

Back in Xcode, go to the **Info** tab of your app target settings. In the **URL Types** section, click the **** button to add a new entry. There, enter `auth0` into the **Identifier** field and `$(PRODUCT_BUNDLE_IDENTIFIER)` into the **URL Schemes** field.
Expand Down

0 comments on commit 47354dc

Please sign in to comment.