Class OAuthPlugin

java.lang.Object
org.codice.ddf.catalog.plugin.oauth.OAuthPlugin
All Implemented Interfaces:
ddf.catalog.plugin.PreFederatedQueryPlugin

public class OAuthPlugin extends Object implements ddf.catalog.plugin.PreFederatedQueryPlugin
If a source is configured to use OAuth 2.0's Authorization Code flow, this plugin will verify that the user has the required tokens to use OAuth 2.0 before proceeding to federate. If an access token is present but has expired, this plugin will attempt to refresh it and update the token storage with the new one. If the user is not logged in or needs to authorize the use of their tokens against this source, an OAuthPluginException will be thrown.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OAuthPlugin(org.codice.ddf.security.token.storage.api.TokenStorage tokenStorage)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    ddf.catalog.operation.QueryRequest
    process(ddf.catalog.source.Source source, ddf.catalog.operation.QueryRequest input)
    Verifies that a source configured to use OAuth has a valid access token to process and that the user has authorized the use of their data against this source.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OAuthPlugin

      public OAuthPlugin(org.codice.ddf.security.token.storage.api.TokenStorage tokenStorage)
  • Method Details

    • process

      public ddf.catalog.operation.QueryRequest process(ddf.catalog.source.Source source, ddf.catalog.operation.QueryRequest input) throws ddf.catalog.plugin.StopProcessingException
      Verifies that a source configured to use OAuth has a valid access token to process and that the user has authorized the use of their data against this source.
      Specified by:
      process in interface ddf.catalog.plugin.PreFederatedQueryPlugin
      Parameters:
      source - source being queried
      input - query request
      Throws:
      ddf.catalog.plugin.OAuthPluginException - if the user's access token is not available or if the source is not authorized
      ddf.catalog.plugin.StopProcessingException - for errors not related to OAuth