use of edu.uiuc.ncsa.security.storage.data.SerializationKeys in project OA4MP by ncsa.
the class SATFactory method getSubject.
public static BaseClient getSubject(JSONObject json) {
JSONObject api = json.getJSONObject(KEYS_API);
JSONObject subject = api.getJSONObject(KEYS_SUBJECT);
if (subject.containsKey(SUBJECT_ADMIN)) {
return getACConverter().fromJSON(subject);
}
if (subject.containsKey(SUBJECT_CLIENT)) {
JSONObject j2 = subject.getJSONObject(SUBJECT_CLIENT);
SerializationKeys k1 = getClientConverter().getKeys();
String secretKey = ((ClientKeys) k1).secret();
if (j2.containsKey(CLIENT_SECRET_KEY)) {
j2.put(secretKey, j2.getString(CLIENT_SECRET_KEY));
j2.remove(CLIENT_SECRET_KEY);
}
return getClientConverter().fromJSON(subject);
}
return null;
}
Aggregations