Skip to content

Commit

Permalink
fix(jans-auth-server): set par expiration to request object exp
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Feb 18, 2022
1 parent 5f109ce commit 798cfa7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.WebApplicationException;
import java.util.Date;
import java.util.Set;

import static io.jans.as.model.util.StringUtils.implode;
Expand Down Expand Up @@ -94,6 +95,9 @@ public void validateRequestObject(RedirectUriResponse redirectUriResponse, Par p
if (jwtRequest.getNbf() != null) {
par.getAttributes().setNbf(jwtRequest.getNbf());
}
if (jwtRequest.getExp() != null) {
par.setExpirationDate(new Date(jwtRequest.getExp() * 1000L));
}
if (!jwtRequest.getScopes().isEmpty()) { // JWT wins
Set<String> scopes = scopeChecker.checkScopesPolicy(client, Lists.newArrayList(jwtRequest.getScopes()));
par.getAttributes().setScope(implode(scopes, " "));
Expand Down

0 comments on commit 798cfa7

Please sign in to comment.