Browse Source

added non-binary export for 1.2+ data compatibility.

1.0.x
Justin Richer 10 years ago
parent
commit
251411e3d7
  1. 20
      openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/MITREidDataService_1_0.java

20
openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/MITREidDataService_1_0.java

@ -216,6 +216,26 @@ public class MITREidDataService_1_0 implements MITREidDataService {
writeAuthorizationRequest(oa2Auth.getAuthorizationRequest(), writer);
String userAuthentication = base64UrlEncodeObject(oa2Auth.getUserAuthentication());
writer.name("userAuthentication").value(userAuthentication);
// this value is for 1.2+ compatibility (dropping binary objects from exports)
writer.name("savedUserAuthentication");
if (oa2Auth.getUserAuthentication() != null) {
writer.beginObject();
writer.name("name").value(oa2Auth.getUserAuthentication().getName());
writer.name("sourceClass").value(oa2Auth.getUserAuthentication().getClass().getName());
writer.name("authenticated").value(oa2Auth.getUserAuthentication().isAuthenticated());
writer.name("authorities");
writer.beginArray();
for (GrantedAuthority authority : oa2Auth.getUserAuthentication().getAuthorities()) {
writer.value(authority.getAuthority());
}
writer.endArray();
writer.endObject();
} else {
writer.nullValue();
}
writer.endObject();
writer.endObject();
logger.debug("Wrote authentication holder {}", holder.getId());

Loading…
Cancel
Save