public void removeRefreshToken(String token) { jdbcTemplate.update(deleteRefreshTokenSql, extractTokenKey(token)); }
public void removeAccessTokenUsingRefreshToken(String refreshToken) { jdbcTemplate.update(deleteAccessTokenFromRefreshTokenSql, new Object[] { extractTokenKey(refreshToken) }, new int[] { Types.VARCHAR }); }
public void removeAccessToken(String tokenValue) { jdbcTemplate.update(deleteAccessTokenSql, extractTokenKey(tokenValue)); }
public OAuth2RefreshToken readRefreshToken(String token) { OAuth2RefreshToken refreshToken = null; try { refreshToken = jdbcTemplate.queryForObject(selectRefreshTokenSql, new RowMapper<OAuth2RefreshToken>() { public OAuth2RefreshToken mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeRefreshToken(rs.getBytes(2)); } }, extractTokenKey(token)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find refresh token for token " + token); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize refresh token for token " + token, e); removeRefreshToken(token); } return refreshToken; }
public OAuth2Authentication readAuthenticationForRefreshToken(String value) { OAuth2Authentication authentication = null; try { authentication = jdbcTemplate.queryForObject(selectRefreshTokenAuthenticationSql, new RowMapper<OAuth2Authentication>() { public OAuth2Authentication mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeAuthentication(rs.getBytes(2)); } }, extractTokenKey(value)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find access token for token " + value); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize access token for " + value, e); removeRefreshToken(value); } return authentication; }
public OAuth2AccessToken readAccessToken(String tokenValue) { OAuth2AccessToken accessToken = null; try { accessToken = jdbcTemplate.queryForObject(selectAccessTokenSql, new RowMapper<OAuth2AccessToken>() { public OAuth2AccessToken mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeAccessToken(rs.getBytes(2)); } }, extractTokenKey(tokenValue)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find access token for token " + tokenValue); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize access token for " + tokenValue, e); removeAccessToken(tokenValue); } return accessToken; }
public OAuth2Authentication readAuthentication(String token) { OAuth2Authentication authentication = null; try { authentication = jdbcTemplate.queryForObject(selectAccessTokenAuthenticationSql, new RowMapper<OAuth2Authentication>() { public OAuth2Authentication mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeAuthentication(rs.getBytes(2)); } }, extractTokenKey(token)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find access token for token " + token); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize authentication for " + token, e); removeAccessToken(token); } return authentication; }
public void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication) { jdbcTemplate.update(insertRefreshTokenSql, new Object[] { extractTokenKey(refreshToken.getValue()), new SqlLobValue(serializeRefreshToken(refreshToken)), new SqlLobValue(serializeAuthentication(authentication)) }, new int[] { Types.VARCHAR, Types.BLOB, Types.BLOB }); }
public void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) { String refreshToken = null; if (token.getRefreshToken() != null) { refreshToken = token.getRefreshToken().getValue(); } if (readAccessToken(token.getValue())!=null) { removeAccessToken(token.getValue()); } jdbcTemplate.update(insertAccessTokenSql, new Object[] { extractTokenKey(token.getValue()), new SqlLobValue(serializeAccessToken(token)), authenticationKeyGenerator.extractKey(authentication), authentication.isClientOnly() ? null : authentication.getName(), authentication.getOAuth2Request().getClientId(), new SqlLobValue(serializeAuthentication(authentication)), extractTokenKey(refreshToken) }, new int[] { Types.VARCHAR, Types.BLOB, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.BLOB, Types.VARCHAR }); }
public void removeRefreshToken(String token) { jdbcTemplate.update(deleteRefreshTokenSql, extractTokenKey(token)); }
public void removeAccessToken(String tokenValue) { jdbcTemplate.update(deleteAccessTokenSql, extractTokenKey(tokenValue)); }
public void removeAccessTokenUsingRefreshToken(String refreshToken) { jdbcTemplate.update(deleteAccessTokenFromRefreshTokenSql, new Object[] { extractTokenKey(refreshToken) }, new int[] { Types.VARCHAR }); }
public OAuth2AccessToken readAccessToken(String tokenValue) { OAuth2AccessToken accessToken = null; try { accessToken = jdbcTemplate.queryForObject(selectAccessTokenSql, new RowMapper<OAuth2AccessToken>() { public OAuth2AccessToken mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeAccessToken(rs.getBytes(2)); } }, extractTokenKey(tokenValue)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find access token for token " + tokenValue); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize access token for " + tokenValue, e); removeAccessToken(tokenValue); } return accessToken; }
public OAuth2Authentication readAuthenticationForRefreshToken(String value) { OAuth2Authentication authentication = null; try { authentication = jdbcTemplate.queryForObject(selectRefreshTokenAuthenticationSql, new RowMapper<OAuth2Authentication>() { public OAuth2Authentication mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeAuthentication(rs.getBytes(2)); } }, extractTokenKey(value)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find access token for token " + value); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize access token for " + value, e); removeRefreshToken(value); } return authentication; }
public OAuth2RefreshToken readRefreshToken(String token) { OAuth2RefreshToken refreshToken = null; try { refreshToken = jdbcTemplate.queryForObject(selectRefreshTokenSql, new RowMapper<OAuth2RefreshToken>() { public OAuth2RefreshToken mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeRefreshToken(rs.getBytes(2)); } }, extractTokenKey(token)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find refresh token for token " + token); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize refresh token for token " + token, e); removeRefreshToken(token); } return refreshToken; }
public OAuth2Authentication readAuthentication(String token) { OAuth2Authentication authentication = null; try { authentication = jdbcTemplate.queryForObject(selectAccessTokenAuthenticationSql, new RowMapper<OAuth2Authentication>() { public OAuth2Authentication mapRow(ResultSet rs, int rowNum) throws SQLException { return deserializeAuthentication(rs.getBytes(2)); } }, extractTokenKey(token)); } catch (EmptyResultDataAccessException e) { if (LOG.isInfoEnabled()) { LOG.info("Failed to find access token for token " + token); } } catch (IllegalArgumentException e) { LOG.warn("Failed to deserialize authentication for " + token, e); removeAccessToken(token); } return authentication; }
public void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication) { jdbcTemplate.update(insertRefreshTokenSql, new Object[] { extractTokenKey(refreshToken.getValue()), new SqlLobValue(serializeRefreshToken(refreshToken)), new SqlLobValue(serializeAuthentication(authentication)) }, new int[] { Types.VARCHAR, Types.BLOB, Types.BLOB }); }
public void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) { String refreshToken = null; if (token.getRefreshToken() != null) { refreshToken = token.getRefreshToken().getValue(); } if (readAccessToken(token.getValue())!=null) { removeAccessToken(token.getValue()); } jdbcTemplate.update(insertAccessTokenSql, new Object[] { extractTokenKey(token.getValue()), new SqlLobValue(serializeAccessToken(token)), authenticationKeyGenerator.extractKey(authentication), authentication.isClientOnly() ? null : authentication.getName(), authentication.getOAuth2Request().getClientId(), new SqlLobValue(serializeAuthentication(authentication)), extractTokenKey(refreshToken) }, new int[] { Types.VARCHAR, Types.BLOB, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.BLOB, Types.VARCHAR }); }