use of org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory in project spring-security-oauth by spring-projects.
the class AbstractEndpoint method afterPropertiesSet.
public void afterPropertiesSet() throws Exception {
Assert.state(tokenGranter != null, "TokenGranter must be provided");
Assert.state(clientDetailsService != null, "ClientDetailsService must be provided");
defaultOAuth2RequestFactory = new DefaultOAuth2RequestFactory(getClientDetailsService());
if (oAuth2RequestFactory == null) {
oAuth2RequestFactory = defaultOAuth2RequestFactory;
}
}
use of org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory in project ORCID-Source by ORCID.
the class OrcidClientCredentialsCheckerTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
oAuth2RequestFactory = new DefaultOAuth2RequestFactory(clientDetailsService);
checker = new OrcidClientCredentialsChecker(oAuth2RequestFactory);
checker.setClientDetailsEntityCacheManager(clientDetailsEntityCacheManager);
checker.setOrcidOAuth2RequestValidator(orcidOAuth2RequestValidator);
}
use of org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory in project spring-security-oauth by spring-projects.
the class ApprovalStoreUserApprovalHandlerTests method init.
@Before
public void init() {
handler.setApprovalStore(store);
InMemoryClientDetailsService clientDetailsService = new InMemoryClientDetailsService();
Map<String, ClientDetails> map = new HashMap<String, ClientDetails>();
map.put("client", new BaseClientDetails("client", null, "read,write", "authorization_code", null));
clientDetailsService.setClientDetailsStore(map);
handler.setRequestFactory(new DefaultOAuth2RequestFactory(clientDetailsService));
userAuthentication = new UsernamePasswordAuthenticationToken("user", "N/A", AuthorityUtils.commaSeparatedStringToAuthorityList("USER"));
}
Aggregations