Skip to content

Commit

Permalink
feat(jans-auth-server): added sid and authn_time for active sessions …
Browse files Browse the repository at this point in the history
…response

#1479
  • Loading branch information
yuriyz committed Jun 1, 2022
1 parent aed8cf3 commit bf9b572
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,25 @@ private JSONObject createJsonObject(SessionId sessionId) {
final Date exp = sessionId.getExpirationDate();
final Date iat = sessionId.getCreationDate();
final Date lastUsedAt = sessionId.getLastUsedAt();
final String sid = sessionId.getOutsideSid();
final Date authnTime = sessionId.getAuthenticationTime();

JSONObject result = new JSONObject();
if (lastUsedAt != null)
result.put("lastUsedAt", dateAsSeconds(lastUsedAt));
if (iat != null)
if (lastUsedAt != null) {
result.put("last_used_at", dateAsSeconds(lastUsedAt));
}
if (iat != null) {
result.put("iat", dateAsSeconds(iat));
if (exp != null)
}
if (exp != null) {
result.put("exp", dateAsSeconds(exp));
}
if (StringUtils.isNotBlank(sid)) {
result.put("sid", sid);
}
if (authnTime != null) {
result.put("authn_time", sid);
}
return result;
}

Expand Down

0 comments on commit bf9b572

Please sign in to comment.