Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strictly compare the OIDC invalid_request message #75

Merged
merged 1 commit into from
Feb 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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