Class TokenController

java.lang.Object
org.odpi.openmetadata.tokencontroller.TokenController
Direct Known Subclasses:
AssetCatalogRESTServices, AutomatedCurationRESTServices, CollectionManagerRESTServices, DataDiscoveryRESTServices, FeedbackManagerRESTServices, GlossaryBrowserRESTServices, GlossaryWorkflowRESTServices, GovernanceAuthorRESTServices, MyProfileRESTServices, ProjectManagerRESTServices, ReferenceDataRESTServices, TemplateManagerRESTServices, ValidMetadataRESTServices

public class TokenController extends Object
This class provides a method to access the userId from the servlet session. This class should be subclassed by the View Service REST Service so that the userId can be obtained and then used on subsequent runtime calls.
  • Constructor Details

    • TokenController

      public TokenController()
  • Method Details

    • getUser

      protected String getUser(String serviceName, String methodName) throws UserNotAuthorizedException
      Return userId extracted from the token in the HTTP header.
      Parameters:
      serviceName - name of the called service
      methodName - name of the called method
      Returns:
      userName or null if there is not one
      Throws:
      UserNotAuthorizedException - user not logged in