text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var sp_client_shared_1 = require("@ms/sp-client-shared");
  var OAuthUtilityContext_1 = require("./OAuthUtilityContext");
  var sp_core_library_1 = require("@microsoft/sp-core-library");
  var OAuthTokenProvider = (function () {
      function OAuthTokenProvider(serviceScope) {
          this._tokenUtility = new sp_client_shared_1.OAuthUtility(new OAuthUtilityContext_1.default(serviceScope));
      }
      OAuthTokenProvider.prototype.getOAuthToken = function (resource, webUrl) {
          sp_core_library_1.Validate.isNotNullOrUndefined(resource, 'resource');
          sp_core_library_1.Validate.isNonemptyString(resource, 'resource');
          return this._tokenUtility.getOAuthToken(resource, webUrl);
      };
      OAuthTokenProvider.prototype.clearCachedToken = function (resource) {
          sp_core_library_1.Validate.isNotNullOrUndefined(resource, 'resource');
          sp_core_library_1.Validate.isNonemptyString(resource, 'resource');
          this._tokenUtility.clearCachedToken(resource);
      };
      OAuthTokenProvider.serviceKey = sp_core_library_1.ServiceKey.create('sp-client-shared:OAuthTokenProvider', OAuthTokenProvider);
      return OAuthTokenProvider;
  }());
  exports.default = OAuthTokenProvider;
  