use of org.springframework.security.oauth.provider.BaseConsumerDetails in project spring-security-oauth by spring-projects.
the class InMemoryNonceServicesTests method consumer.
private ConsumerDetails consumer(String name) {
BaseConsumerDetails details = new BaseConsumerDetails();
details.setConsumerKey(name);
return details;
}
use of org.springframework.security.oauth.provider.BaseConsumerDetails in project opencast by opencast.
the class OAuthSingleConsumerDetailsService method createConsumerDetails.
/**
* Creates a spring security consumer details object, suitable to achieve two-legged OAuth.
*
* @param consumerKey
* the consumer key
* @param consumerName
* the consumer name
* @param consumerSecret
* the consumer secret
* @return the consumer details
*/
private ExtraTrustConsumerDetails createConsumerDetails(String consumerKey, String consumerName, String consumerSecret) {
SharedConsumerSecret secret = new SharedConsumerSecret(consumerSecret);
BaseConsumerDetails bcd = new BaseConsumerDetails();
bcd.setConsumerKey(consumerKey);
bcd.setConsumerName(consumerName);
bcd.setSignatureSecret(secret);
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
authorities.add(new GrantedAuthorityImpl("ROLE_OAUTH_USER"));
bcd.setAuthorities(authorities);
// false for 2 legged OAuth
bcd.setRequiredToObtainAuthenticatedToken(false);
return bcd;
}
Aggregations