Exemple #1
0
        private string GetAuthHeaderValue(bool refreshToken = false)
        {
            if (_bearerToken == null || refreshToken)
            {
                _bearerToken = _tokenRetriever.ObtainNewBearerToken();
            }

            return("Bearer " + _bearerToken);
        }
        public string GetBearerToken()
        {
            _log.Debug("Getting a new OAuth token");
            var task = Task.Run(() => _tokenRetriever.ObtainNewBearerToken());

            task.Wait();

            var bearerToken = task.Result;

            return(bearerToken.Access_token);
        }
 public void UpdateToken(ITokenRetriever tokenRetriever)
 {
     bearerToken = tokenRetriever.ObtainNewBearerToken();
 }
        public string Authenticate()
        {
            var result = _tokenRetriever.ObtainNewBearerToken();

            return(result);
        }