From a6af353571d2c97be11aafa224880f17615a12ab Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Wed, 1 Feb 2017 11:14:24 -0300 Subject: [PATCH] strictly compare the oidc invalid_request message --- .../android/authentication/AuthenticationException.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.java b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.java index f5aedf58c..4a782ed8b 100644 --- a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.java +++ b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.java @@ -41,6 +41,9 @@ public class AuthenticationException extends Auth0Exception { private static final String DEFAULT_MESSAGE = "An error occurred when trying to authenticate with the server."; + private static final String ERROR_OIDC_ACCESS_TOKEN = "OIDC conformant clients cannot use /oauth/access_token"; + private static final String ERROR_OIDC_RO = "OIDC conformant clients cannot use /oauth/ro"; + private String code; private String description; private int statusCode; @@ -89,7 +92,7 @@ public AuthenticationException(Map values) { } private void warnIfOIDCError() { - if ("invalid_request".equals(getCode())) { + if ("invalid_request".equals(getCode()) && (ERROR_OIDC_ACCESS_TOKEN.equals(getDescription()) || ERROR_OIDC_RO.equals(getDescription()))) { Log.w(AuthenticationAPIClient.class.getSimpleName(), "Your Auth0 Client is configured as 'OIDC Conformant' but this instance it's not. To authenticate you will need to enable the flag by calling Auth0#setOIDCConformant(true) on the Auth0 instance you used in the setup."); } }