Class TokenController

java.lang.Object
org.odpi.openmetadata.tokencontroller.TokenController
Direct Known Subclasses:
ActionAuthorRESTServices, AssetCatalogRESTServices, AutomatedCurationRESTServices, ClassificationManagerRESTServices, CollectionManagerRESTServices, DataDesignerRESTServices, DataDiscoveryRESTServices, DataOfficerRESTServices, DevopsPipelineRESTServices, FeedbackManagerRESTServices, GlossaryBrowserRESTServices, GlossaryManagerRESTServices, GovernanceOfficerRESTServices, MetadataExplorerRESTServices, MyProfileRESTServices, NotificationManagerRESTServices, PeopleOrganizerRESTServices, PrivacyOfficerRESTServices, ProjectManagerRESTServices, ReferenceDataRESTServices, RuntimeManagerRESTServices, SecurityOfficerRESTServices, 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