Skip to content

Commit

Permalink
strictly compare the oidc invalid_request message
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Feb 1, 2017
1 parent 3b8780d commit a6af353
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -89,7 +92,7 @@ public AuthenticationException(Map<String, Object> 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.");
}
}
Expand Down

0 comments on commit a6af353

Please sign in to comment.