@Override public void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) { String authenticationKey = authenticationKeyGenerator.extractKey(authentication); String userLogin = authentication.getName(); ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpServletRequest request = attributes.getRequest(); Locale locale = restAuthUtils.extractLocaleFromRequestHeader(request); String refreshTokenValue = token.getRefreshToken() != null ? token.getRefreshToken().getValue() : null; serverTokenStore.storeAccessToken(token.getValue(), serializeAccessToken(token), authenticationKey, serializeAuthentication(authentication), token.getExpiration(), userLogin, locale, refreshTokenValue); processSession(authentication, token.getValue()); log.info("REST API access token stored: [{}] {}", authentication.getPrincipal(), tokenMasker.maskToken(token.getValue())) ; }