use of org.springframework.security.oauth2.provider.token.store.JdbcTokenStore in project spring-security-oauth by spring-projects.
the class AbstractIntegrationTests method clear.
private void clear(TokenStore tokenStore) throws Exception {
if (tokenStore instanceof Advised) {
Advised advised = (Advised) tokenStore;
TokenStore target = (TokenStore) advised.getTargetSource().getTarget();
clear(target);
return;
}
if (tokenStore instanceof InMemoryTokenStore) {
((InMemoryTokenStore) tokenStore).clear();
}
if (tokenStore instanceof JdbcTokenStore) {
JdbcTemplate template = new JdbcTemplate(dataSource);
template.execute("delete from oauth_access_token");
template.execute("delete from oauth_refresh_token");
template.execute("delete from oauth_client_token");
template.execute("delete from oauth_code");
}
}
use of org.springframework.security.oauth2.provider.token.store.JdbcTokenStore in project spring-security-oauth by spring-projects.
the class Application method tokenStore.
@Bean
public JwtTokenStore tokenStore() throws Exception {
JwtAccessTokenConverter enhancer = new JwtAccessTokenConverter();
// N.B. in a real system you would have to configure the verifierKey (or use JdbcTokenStore)
enhancer.afterPropertiesSet();
return new JwtTokenStore(enhancer);
}
Aggregations