Class OAuthConfiguration

java.lang.Object
org.eclipse.lyo.server.oauth.core.OAuthConfiguration

public class OAuthConfiguration extends Object
Manages the OAuth provider configuration, including the validator, consumer store, and token strategy.
Author:
Samuel Padgett
  • Method Details

    • getInstance

      public static OAuthConfiguration 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

      public TokenStrategy getTokenStrategy()
      Gets the strategy used to generate and verify OAuth tokens.
      Returns:
      the token strategy
    • setTokenStrategy

      public void setTokenStrategy(TokenStrategy tokenStrategy)
      Sets the strategy used to generate and verify OAuth tokens.
      Parameters:
      tokenStrategy - the strategy
    • getConsumerStore

      public ConsumerStore getConsumerStore()
      Gets the store used for managing consumers.
      Returns:
      the consumer store
    • setConsumerStore

      public void setConsumerStore(ConsumerStore consumerStore) throws ConsumerStoreException
      Sets the store used for managing consumers.
      Parameters:
      consumerStore - the consumer store
      Throws:
      ConsumerStoreException - on errors initializing the consumer registry
    • getApplication

      public Application getApplication() throws net.oauth.OAuthProblemException
      Throws:
      net.oauth.OAuthProblemException
    • setApplication

      public void setApplication(Application application)
    • 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

      public String getServletUri()
    • setServletUri

      public 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. 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.