Don't check for "scope" element when verifying code

This commit is contained in:
Peter Stuifzand 2018-04-21 23:55:30 +02:00
parent 8d5b4b83e0
commit f9a13363c6

View File

@ -34,7 +34,6 @@ public class VerifyAuthenticationTask extends AsyncTask<String, Void, VerifyAuth
private String errorMessage; private String errorMessage;
public String me; public String me;
public String scope;
public String code; public String code;
public AuthenticationResult(String errorMessage) { public AuthenticationResult(String errorMessage) {
@ -42,10 +41,9 @@ public class VerifyAuthenticationTask extends AsyncTask<String, Void, VerifyAuth
this.errorMessage = errorMessage; this.errorMessage = errorMessage;
} }
public AuthenticationResult(String me, String scope, String code) { public AuthenticationResult(String me, String code) {
this.success = true; this.success = true;
this.me = me; this.me = me;
this.scope = scope;
this.code = code; this.code = code;
} }
@ -113,12 +111,7 @@ public class VerifyAuthenticationTask extends AsyncTask<String, Void, VerifyAuth
return new AuthenticationResult("Missing element \"me\" in authorization_endpoint response"); return new AuthenticationResult("Missing element \"me\" in authorization_endpoint response");
} }
String resultMe = meElement.getAsString(); String resultMe = meElement.getAsString();
JsonElement scopeElement = element.get("scope"); return new AuthenticationResult(resultMe, code);
if (scopeElement == null) {
return new AuthenticationResult("Missing element \"scope\" in authorization_endpoint response");
}
String resultScope = scopeElement.getAsString();
return new AuthenticationResult(resultMe, resultScope, code);
} catch (JsonParseException e) { } catch (JsonParseException e) {
return new AuthenticationResult("Could not parse json response from authorization_endpoint"); return new AuthenticationResult("Could not parse json response from authorization_endpoint");
} }