use of org.springframework.security.oauth2.provider.password.ResourceOwnerPasswordTokenGranter in project spring-security-oauth by spring-projects.
the class ResourceOwnerPasswordTokenGranterTests method testPasswordRemoved.
@Test
public void testPasswordRemoved() {
ResourceOwnerPasswordTokenGranter granter = new ResourceOwnerPasswordTokenGranter(authenticationManager, providerTokenServices, clientDetailsService, requestFactory);
OAuth2AccessToken token = granter.grant("password", tokenRequest);
OAuth2Authentication authentication = providerTokenServices.loadAuthentication(token.getValue());
assertNotNull(authentication.getOAuth2Request().getRequestParameters().get("username"));
assertNull(authentication.getOAuth2Request().getRequestParameters().get("password"));
}
Aggregations