Class OAuthConfiguration
java.lang.Object
org.eclipse.lyo.server.oauth.core.OAuthConfiguration
Manages the OAuth provider configuration, including the validator, consumer store, and
token strategy.
- Author:
- Samuel Padgett
-
Method Summary
Modifier and TypeMethodDescriptionGets the store used for managing consumers.static OAuthConfiguration
Gets the strategy used to generate and verify OAuth tokens.net.oauth.OAuthValidator
Gets the OAuth validator for validating request signatures.boolean
Is OAuth version 1.0 allowed, or do we require 1.0a?void
setApplication
(Application application) void
setConsumerStore
(ConsumerStore consumerStore) Sets the store used for managing consumers.void
setServletUri
(String servletUri) Sets the official servlet URL (typically set using OSLC4JUtils.getServletURI()) in case this can differ from that in the individual requests.void
setTokenStrategy
(TokenStrategy tokenStrategy) Sets the strategy used to generate and verify OAuth tokens.void
setV1_0Allowed
(boolean allowed) Sets if we allow OAuth 1.0.void
setValidator
(net.oauth.OAuthValidator validator) Sets the OAuth validator for validating request signatures.
-
Method Details
-
getInstance
-
getValidator
public net.oauth.OAuthValidator getValidator()Gets the OAuth validator for validating request signatures.- Returns:
- the validator
-
setValidator
public void setValidator(net.oauth.OAuthValidator validator) Sets the OAuth validator for validating request signatures.- Parameters:
validator
- the validator
-
getTokenStrategy
Gets the strategy used to generate and verify OAuth tokens.- Returns:
- the token strategy
-
setTokenStrategy
Sets the strategy used to generate and verify OAuth tokens.- Parameters:
tokenStrategy
- the strategy
-
getConsumerStore
Gets the store used for managing consumers.- Returns:
- the consumer store
-
setConsumerStore
Sets the store used for managing consumers.- Parameters:
consumerStore
- the consumer store- Throws:
ConsumerStoreException
- on errors initializing the consumer registry
-
getApplication
- Throws:
net.oauth.OAuthProblemException
-
setApplication
-
isV1_0Allowed
public boolean isV1_0Allowed()Is OAuth version 1.0 allowed, or do we require 1.0a?- Returns:
- true if version 1.0 is allowed
- See Also:
-
setV1_0Allowed
public void setV1_0Allowed(boolean allowed) Sets if we allow OAuth 1.0.- Parameters:
allowed
- true to allow OAuth version 1.0 requests or false to require OAuth version 1.0a- See Also:
-
getServletUri
-
setServletUri
Sets the official servlet URL (typically set using OSLC4JUtils.getServletURI()) in case this can differ from that in the individual requests. This is important to set correctly to compute the digital signature. An individual request URL is then constructed by appending this servletUrl with request.getPathInfo().- Parameters:
servletUri
- the official servlet URL of the request. If this parameter is null, this method will try to reconstruct the URL from the HTTP request; which may be wrong in some cases.
-