protected static boolean isExpired(ServerAccessToken token) { return System.currentTimeMillis() < (token.getIssuedAt() + token.getExpiresIn()); }
protected static boolean isExpired(ServerAccessToken token) { return System.currentTimeMillis() < (token.getIssuedAt() + token.getExpiresIn()); }
state.append(token.getIssuedAt());
state.append(token.getIssuedAt());
@Override public ServerAccessToken getPreauthorizedToken(Client client, List<String> requestedScopes, UserSubject sub, String grantType) throws OAuthServiceException { if (!isSupportPreauthorizedTokens()) { return null; } ServerAccessToken token = null; for (ServerAccessToken at : getAccessTokens(client, sub)) { if (at.getClient().getClientId().equals(client.getClientId()) && at.getGrantType().equals(grantType) && (sub == null && at.getSubject() == null || sub != null && at.getSubject().getLogin().equals(sub.getLogin()))) { token = at; break; } } if (token != null && OAuthUtils.isExpired(token.getIssuedAt(), token.getExpiresIn())) { revokeToken(client, token.getTokenKey(), OAuthConstants.ACCESS_TOKEN); token = null; } return token; }
@Override public ServerAccessToken getPreauthorizedToken(Client client, List<String> requestedScopes, UserSubject sub, String grantType) throws OAuthServiceException { if (!isSupportPreauthorizedTokens()) { return null; } ServerAccessToken token = null; for (ServerAccessToken at : getAccessTokens(client, sub)) { if (at.getClient().getClientId().equals(client.getClientId()) && at.getGrantType().equals(grantType) && (sub == null && at.getSubject() == null || sub != null && at.getSubject().getLogin().equals(sub.getLogin()))) { token = at; break; } } if (token != null && OAuthUtils.isExpired(token.getIssuedAt(), token.getExpiresIn())) { revokeToken(client, token.getTokenKey(), OAuthConstants.ACCESS_TOKEN); token = null; } return token; }
getJwtAccessTokenClaimMap()); claims.setClaim(clientIdClaimName, at.getClient().getClientId()); claims.setIssuedAt(at.getIssuedAt()); if (at.getExpiresIn() > 0) { claims.setExpiryTime(at.getIssuedAt() + at.getExpiresIn());
getJwtAccessTokenClaimMap()); claims.setClaim(clientIdClaimName, at.getClient().getClientId()); claims.setIssuedAt(at.getIssuedAt()); if (at.getExpiresIn() > 0) { claims.setExpiryTime(at.getIssuedAt() + at.getExpiresIn());
if (at == null || OAuthUtils.isExpired(at.getIssuedAt(), at.getExpiresIn())) { return new TokenIntrospection(false); response.setIat(at.getIssuedAt()); if (at.getExpiresIn() > 0) { response.setExp(at.getIssuedAt() + at.getExpiresIn());
if (at == null || OAuthUtils.isExpired(at.getIssuedAt(), at.getExpiresIn())) { return new TokenIntrospection(false); response.setIat(at.getIssuedAt()); if (at.getExpiresIn() > 0) { response.setExp(at.getIssuedAt() + at.getExpiresIn());
public AccessTokenValidation(ServerAccessToken token) { this.clientId = token.getClient().getClientId(); this.clientSubject = token.getClient().getSubject(); this.isClientConfidential = token.getClient().isConfidential(); this.clientIpAddress = token.getClient().getClientIpAddress(); this.tokenKey = token.getTokenKey(); this.tokenType = token.getTokenType(); this.tokenGrantType = token.getGrantType(); this.tokenIssuedAt = token.getIssuedAt(); this.tokenLifetime = token.getExpiresIn(); this.tokenNotBefore = token.getNotBefore(); this.tokenIssuer = token.getIssuer(); this.tokenSubject = token.getSubject(); this.tokenScopes = token.getScopes(); this.audiences = token.getAudiences(); this.clientCodeVerifier = token.getClientCodeVerifier(); this.extraProps.putAll(token.getExtraProperties()); }
protected ServerAccessToken(ServerAccessToken token, String key) { super(token.getTokenType(), key, token.getExpiresIn(), token.getIssuedAt(), token.getRefreshToken(), token.getParameters()); this.client = token.getClient(); this.grantType = token.getGrantType(); this.scopes = token.getScopes(); this.audiences = token.getAudiences(); this.subject = token.getSubject(); this.responseType = token.getResponseType(); this.clientCodeVerifier = token.getClientCodeVerifier(); this.nonce = token.getNonce(); this.grantCode = token.getGrantCode(); }
public AccessTokenValidation(ServerAccessToken token) { this.clientId = token.getClient().getClientId(); this.clientSubject = token.getClient().getSubject(); this.isClientConfidential = token.getClient().isConfidential(); this.clientIpAddress = token.getClient().getClientIpAddress(); this.tokenKey = token.getTokenKey(); this.tokenType = token.getTokenType(); this.tokenGrantType = token.getGrantType(); this.tokenIssuedAt = token.getIssuedAt(); this.tokenLifetime = token.getExpiresIn(); this.tokenNotBefore = token.getNotBefore(); this.tokenIssuer = token.getIssuer(); this.tokenSubject = token.getSubject(); this.tokenScopes = token.getScopes(); this.audiences = token.getAudiences(); this.clientCodeVerifier = token.getClientCodeVerifier(); this.extraProps.putAll(token.getExtraProperties()); }
protected ServerAccessToken(ServerAccessToken token, String key) { super(token.getTokenType(), key, token.getExpiresIn(), token.getIssuedAt(), token.getRefreshToken(), token.getParameters()); this.client = token.getClient(); this.grantType = token.getGrantType(); this.scopes = token.getScopes(); this.audiences = token.getAudiences(); this.subject = token.getSubject(); this.responseType = token.getResponseType(); this.clientCodeVerifier = token.getClientCodeVerifier(); this.nonce = token.getNonce(); this.grantCode = token.getGrantCode(); }