Skip to content

Commit

Permalink
feat(jans-auth-server): OAuth 2.0 Step-up - added acr and auth_time t…
Browse files Browse the repository at this point in the history
…o introspection response #2589
  • Loading branch information
yuriyz committed Feb 20, 2023
1 parent 51c0750 commit 665c3a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public class IntrospectionResponse {
private String issuer;
@JsonProperty(value = "jti")
private String jti;
@JsonProperty(value = "acr_values")
private String acrValues;
@JsonProperty(value = "acr")
private String acr;
@JsonProperty(value = "auth_time")
private Integer authTime;

// DPoP
@JsonProperty(value = "nbf")
Expand All @@ -69,12 +71,20 @@ public IntrospectionResponse(boolean active) {
this.active = active;
}

public String getAcrValues() {
return acrValues;
public String getAcr() {
return acr;
}

public void setAcrValues(String acrValues) {
this.acrValues = acrValues;
public void setAcr(String acr) {
this.acr = acr;
}

public Integer getAuthTime() {
return authTime;
}

public void setAuthTime(Integer authTime) {
this.authTime = authTime;
}

public boolean isActive() {
Expand Down Expand Up @@ -195,7 +205,8 @@ public String toString() {
", audience='" + audience + '\'' +
", issuer='" + issuer + '\'' +
", jti='" + jti + '\'' +
", acrValues='" + acrValues + '\'' +
", acr='" + acr + '\'' +
", authTime='" + authTime + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,14 @@ private AbstractToken fillResponse(String token, IntrospectionResponse response,
response.setActive(tokenToIntrospect.isValid());
response.setExpiresAt(ServerUtil.dateToSeconds(tokenToIntrospect.getExpirationDate()));
response.setIssuedAt(ServerUtil.dateToSeconds(tokenToIntrospect.getCreationDate()));
response.setAcrValues(grantOfIntrospectionToken.getAcrValues());
response.setAcr(grantOfIntrospectionToken.getAcrValues());
response.setScope(grantOfIntrospectionToken.getScopes() != null ? grantOfIntrospectionToken.getScopes() : Lists.newArrayList()); // #433
response.setClientId(grantOfIntrospectionToken.getClientId());
response.setSub(grantOfIntrospectionToken.getSub());
response.setUsername(grantOfIntrospectionToken.getUserId());
response.setIssuer(appConfiguration.getIssuer());
response.setAudience(grantOfIntrospectionToken.getClientId());
response.setAuthTime(ServerUtil.dateToSeconds(grantOfIntrospectionToken.getAuthenticationTime()));

if (tokenToIntrospect instanceof AccessToken) {
AccessToken accessToken = (AccessToken) tokenToIntrospect;
Expand Down

0 comments on commit 665c3a6

Please sign in to comment.