changed name of clientAuthorization to authorizationRequest (which is more accurate), closes #697

pull/745/head
Justin Richer 2014-12-19 00:55:06 -05:00
parent a1228d19b5
commit ba97fcb88a
2 changed files with 9 additions and 9 deletions

View File

@ -207,8 +207,8 @@ public class MITREidDataService_1_2 extends MITREidDataService_1_X {
writer.name("ownerId").value(holder.getOwnerId());
writer.name("authentication");
writer.beginObject();
writer.name("authorizationRequest");
OAuth2Authentication oa2Auth = holder.getAuthentication();
writer.name("clientAuthorization");
writeAuthorizationRequest(oa2Auth.getOAuth2Request(), writer);
String userAuthentication = base64UrlEncodeObject(oa2Auth.getUserAuthentication());
writer.name("userAuthentication").value(userAuthentication);
@ -658,7 +658,7 @@ public class MITREidDataService_1_2 extends MITREidDataService_1_X {
//not needed
reader.skipValue();
} else if (name.equals("authentication")) {
OAuth2Request clientAuthorization = null;
OAuth2Request authorizationRequest = null;
Authentication userAuthentication = null;
reader.beginObject();
while (reader.hasNext()) {
@ -667,8 +667,8 @@ public class MITREidDataService_1_2 extends MITREidDataService_1_X {
continue;
case NAME:
String subName = reader.nextName();
if (subName.equals("clientAuthorization")) {
clientAuthorization = readAuthorizationRequest(reader);
if (subName.equals("authorizationRequest")) {
authorizationRequest = readAuthorizationRequest(reader);
} else if (subName.equals("userAuthentication")) {
if (reader.peek() == JsonToken.NULL) {
reader.skipValue();
@ -688,7 +688,7 @@ public class MITREidDataService_1_2 extends MITREidDataService_1_X {
}
}
reader.endObject();
OAuth2Authentication auth = new OAuth2Authentication(clientAuthorization, userAuthentication);
OAuth2Authentication auth = new OAuth2Authentication(authorizationRequest, userAuthentication);
ahe.setAuthentication(auth);
} else {
logger.debug("Found unexpected entry");

View File

@ -1477,9 +1477,9 @@ public class TestMITREidDataService_1_2 {
"\"" + MITREidDataService.SYSTEMSCOPES + "\": [], " +
"\"" + MITREidDataService.AUTHENTICATIONHOLDERS + "\": [" +
"{\"id\":1,\"authentication\":{\"clientAuthorization\":{\"clientId\":\"client1\",\"redirectUri\":\"http://foo.com\"},"
"{\"id\":1,\"authentication\":{\"authorizationRequest\":{\"clientId\":\"client1\",\"redirectUri\":\"http://foo.com\"},"
+ "\"userAuthentication\":null}}," +
"{\"id\":2,\"authentication\":{\"clientAuthorization\":{\"clientId\":\"client2\",\"redirectUri\":\"http://bar.com\"},"
"{\"id\":2,\"authentication\":{\"authorizationRequest\":{\"clientId\":\"client2\",\"redirectUri\":\"http://bar.com\"},"
+ "\"userAuthentication\":null}}" +
" ]" +
"}";
@ -1752,9 +1752,9 @@ public class TestMITREidDataService_1_2 {
"\"" + MITREidDataService.BLACKLISTEDSITES + "\": [], " +
"\"" + MITREidDataService.AUTHENTICATIONHOLDERS + "\": [" +
"{\"id\":1,\"authentication\":{\"clientAuthorization\":{\"clientId\":\"client1\",\"redirectUri\":\"http://foo.com\"},"
"{\"id\":1,\"authentication\":{\"authorizationRequest\":{\"clientId\":\"client1\",\"redirectUri\":\"http://foo.com\"},"
+ "\"userAuthentication\":null}}," +
"{\"id\":2,\"authentication\":{\"clientAuthorization\":{\"clientId\":\"client2\",\"redirectUri\":\"http://bar.com\"},"
"{\"id\":2,\"authentication\":{\"authorizationRequest\":{\"clientId\":\"client2\",\"redirectUri\":\"http://bar.com\"},"
+ "\"userAuthentication\":null}}" +
" ]," +
"\"" + MITREidDataService.REFRESHTOKENS + "\": [" +