Example usage for org.springframework.security.oauth2.provider.token DefaultTokenServices setAuthenticationManager

List of usage examples for org.springframework.security.oauth2.provider.token DefaultTokenServices setAuthenticationManager

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.provider.token DefaultTokenServices setAuthenticationManager.

Prototype

public void setAuthenticationManager(AuthenticationManager authenticationManager) 

Source Link

Document

An authentication manager that will be used (if provided) to check the user authentication when a token is refreshed.

Usage

From source file:org.joyrest.oauth2.initializer.OAuth2Initializer.java

private DefaultTokenServices tokenServices(final ClientDetailsService clientService,
        final AuthenticationManager manager, final TokenStore tokenStore, final DataSource dataSource) {

    DefaultTokenServices tokenServices = new DefaultTokenServices();
    tokenServices.setSupportRefreshToken(true);
    tokenServices.setClientDetailsService(clientService);
    tokenServices.setAuthenticationManager(manager);
    tokenServices.setTokenStore(tokenStore);

    if (isNull(dataSource)) {
        return tokenServices;
    } else {//from  www  . j a v a2s .  co  m
        return txProxiedTokenServices(tokenServices, dataSource);
    }
}