Skip to content

Commit

Permalink
Don't check for "scope" element when verifying code
Browse files Browse the repository at this point in the history
  • Loading branch information
pstuifzand committed Apr 21, 2018
1 parent 8d5b4b8 commit f9a1336
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,16 @@ public class AuthenticationResult {
private String errorMessage;

public String me;
public String scope;
public String code;

public AuthenticationResult(String errorMessage) {
this.success = false;
this.errorMessage = errorMessage;
}

public AuthenticationResult(String me, String scope, String code) {
public AuthenticationResult(String me, String code) {
this.success = true;
this.me = me;
this.scope = scope;
this.code = code;
}

Expand Down Expand Up @@ -113,12 +111,7 @@ protected AuthenticationResult doInBackground(String[] args) {
return new AuthenticationResult("Missing element \"me\" in authorization_endpoint response");
}
String resultMe = meElement.getAsString();
JsonElement scopeElement = element.get("scope");
if (scopeElement == null) {
return new AuthenticationResult("Missing element \"scope\" in authorization_endpoint response");
}
String resultScope = scopeElement.getAsString();
return new AuthenticationResult(resultMe, resultScope, code);
return new AuthenticationResult(resultMe, code);
} catch (JsonParseException e) {
return new AuthenticationResult("Could not parse json response from authorization_endpoint");
}
Expand Down

0 comments on commit f9a1336

Please sign in to comment.