use of edu.uiuc.ncsa.myproxy.oa4mp.oauth2.flows.FlowStates in project OA4MP by ncsa.
the class OA2TConverter method fromMap.
@Override
public V fromMap(ConversionMap<String, Object> map, V v) {
V st = super.fromMap(map, v);
Object refreshToken = map.get(getTCK().refreshToken());
if (refreshToken != null) {
if (refreshToken instanceof RefreshToken) {
st.setRefreshToken((RefreshToken) refreshToken);
} else {
st.setRefreshToken(getTF2().getRefreshToken(refreshToken.toString()));
}
}
st.setRefreshTokenValid(map.getBoolean(getTCK().refreshTokenValid()));
st.setRefreshTokenLifetime(map.getLong(getTCK().expiresIn()));
st.setCallback(map.getURI(getTCK().callbackUri()));
st.setNonce(map.getString(getTCK().nonce()));
if (map.get(getTCK().scopes()) != null) {
net.sf.json.JSONArray json = (JSONArray) JSONSerializer.toJSON(map.get(getTCK().scopes()));
Collection<String> zzz = (Collection<String>) JSONSerializer.toJava(json);
st.setScopes(zzz);
}
if (map.get(getTCK().authTime()) != null) {
st.setAuthTime(map.getDate(getTCK().authTime));
}
if (map.get(getTCK().flowStates()) != null) {
st.setFlowStates(new FlowStates((JSONObject) JSONSerializer.toJSON(map.get(getTCK().flowStates()))));
} else {
st.setFlowStates(new FlowStates());
}
return st;
}
Aggregations