From f785b89fdf3ae287a2b57200ce38d57666fc6fd8 Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Tue, 28 May 2019 14:07:12 -0300 Subject: [PATCH 1/2] Update PKCE usage requirements and errors --- README.md | 2 +- .../auth0/android/authentication/AuthenticationAPIClient.java | 2 +- auth0/src/main/java/com/auth0/android/provider/PKCE.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e11c21aa..21cfa43cc 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ WebAuthProvider.init(account) #### Use Code grant with PKCE -> Before you can use `Code Grant` in Android, make sure to go to your [application's section](https://manage.auth0.com/#/applications) in dashboard and check in the Settings that `Client Type` is `Native`. +> Before you can use `Code Grant` in Android, make sure to go to your [application's section](https://manage.auth0.com/#/applications) in the dashboard and check in the Settings that `Token Endpoint Authentication Method` is set to `None` and `Application Type` is set to `Native`. ```java diff --git a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java index 17f45d857..f225176df 100755 --- a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java +++ b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java @@ -661,7 +661,7 @@ public DatabaseConnectionRequest resetPassword(@N /** * Request the revoke of a given refresh_token. Once revoked, the refresh_token cannot be used to obtain new tokens. - * The client must be of type 'Native' or have the 'Token Endpoint Authentication Method' set to 'none' for this endpoint to work. + * The application must be of type 'Native' and have the 'Token Endpoint Authentication Method' set to 'None' for this endpoint to work. * Example usage: *
      * {@code
diff --git a/auth0/src/main/java/com/auth0/android/provider/PKCE.java b/auth0/src/main/java/com/auth0/android/provider/PKCE.java
index 1875055b7..1fd662629 100644
--- a/auth0/src/main/java/com/auth0/android/provider/PKCE.java
+++ b/auth0/src/main/java/com/auth0/android/provider/PKCE.java
@@ -93,7 +93,7 @@ public void onSuccess(Credentials payload) {
                     @Override
                     public void onFailure(AuthenticationException error) {
                         if ("Unauthorized".equals(error.getDescription())) {
-                            Log.e(TAG, "Please go to 'https://manage.auth0.com/#/applications/" + apiClient.getClientId() + "/settings' and set 'Client Type' to 'Native' to enable PKCE.");
+                            Log.e(TAG, "Please go to 'https://manage.auth0.com/#/applications/" + apiClient.getClientId() + "/settings' and set 'Token Endpoint Authentication Method' to 'None' and 'Application Type' to 'Native' to enable PKCE.");
                         }
                         callback.onFailure(error);
                     }

From daa22f0a4ef430ce67fd216c6b7b05cb6387a677 Mon Sep 17 00:00:00 2001
From: Luciano Balmaceda 
Date: Wed, 29 May 2019 10:22:22 -0300
Subject: [PATCH 2/2] improve wording

---
 README.md                                                       | 2 +-
 .../auth0/android/authentication/AuthenticationAPIClient.java   | 2 +-
 auth0/src/main/java/com/auth0/android/provider/PKCE.java        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 21cfa43cc..3863520d0 100644
--- a/README.md
+++ b/README.md
@@ -224,7 +224,7 @@ WebAuthProvider.init(account)
 
 #### Use Code grant with PKCE
 
-> Before you can use `Code Grant` in Android, make sure to go to your [application's section](https://manage.auth0.com/#/applications) in the dashboard and check in the Settings that `Token Endpoint Authentication Method` is set to `None` and `Application Type` is set to `Native`.
+> To use the `Code Grant` in Android, go to your [Application](https://manage.auth0.com/#/applications) in the dashboard, Settings tab, set `Application Type` to `Native` and `Token Endpoint Authentication Method` to `None`.
 
 
 ```java
diff --git a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java
index f225176df..e6130c7c7 100755
--- a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java
+++ b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java
@@ -661,7 +661,7 @@ public DatabaseConnectionRequest resetPassword(@N
 
     /**
      * Request the revoke of a given refresh_token. Once revoked, the refresh_token cannot be used to obtain new tokens.
-     * The application must be of type 'Native' and have the 'Token Endpoint Authentication Method' set to 'None' for this endpoint to work.
+     * Your Auth0 Application Type should be set to 'Native' and Token Endpoint Authentication Method must be set to 'None'.
      * Example usage:
      * 
      * {@code
diff --git a/auth0/src/main/java/com/auth0/android/provider/PKCE.java b/auth0/src/main/java/com/auth0/android/provider/PKCE.java
index 1fd662629..1f1143be4 100644
--- a/auth0/src/main/java/com/auth0/android/provider/PKCE.java
+++ b/auth0/src/main/java/com/auth0/android/provider/PKCE.java
@@ -93,7 +93,7 @@ public void onSuccess(Credentials payload) {
                     @Override
                     public void onFailure(AuthenticationException error) {
                         if ("Unauthorized".equals(error.getDescription())) {
-                            Log.e(TAG, "Please go to 'https://manage.auth0.com/#/applications/" + apiClient.getClientId() + "/settings' and set 'Token Endpoint Authentication Method' to 'None' and 'Application Type' to 'Native' to enable PKCE.");
+                            Log.e(TAG, "Unable to complete authentication with PKCE. PKCE support can be enabled by setting Application Type to 'Native' and Token Endpoint Authentication Method to 'None' for this app at 'https://manage.auth0.com/#/applications/" + apiClient.getClientId() + "/settings'.");
                         }
                         callback.onFailure(error);
                     }