Пример #1
0
        protected override Task <SecurityToken> OnGetTokenAsync(string appliesTo, string action, TimeSpan timeout)
        {
            string tokenString   = this.BuildSignature(appliesTo);
            var    securityToken = new SharedAccessSignatureToken(tokenString);

            return(Task.FromResult <SecurityToken>(securityToken));
        }
Пример #2
0
        /// <summary>
        /// Gets a <see cref="SecurityToken"/> for the given audience and duration.
        /// </summary>
        /// <param name="appliesTo">The URI which the access token applies to</param>
        /// <param name="timeout">The time span that specifies the timeout value for the message that gets the security token</param>
        /// <returns><see cref="SecurityToken"/></returns>
        public override Task <SecurityToken> GetTokenAsync(string appliesTo, TimeSpan timeout)
        {
            TimeoutHelper.ThrowIfNegativeArgument(timeout);
            appliesTo = NormalizeAppliesTo(appliesTo);
            string tokenString   = this.BuildSignature(appliesTo);
            var    securityToken = new SharedAccessSignatureToken(tokenString);

            return(Task.FromResult <SecurityToken>(securityToken));
        }
Пример #3
0
 internal SharedAccessSignatureTokenProvider(string sharedAccessSignature)
 {
     SharedAccessSignatureToken.Validate(sharedAccessSignature);
     this.sharedAccessSignature = sharedAccessSignature;
 }
Пример #4
0
 internal SharedAccessSignatureTokenProvider(string sharedAccessSignature)
     : base(TokenScope.Entity)
 {
     SharedAccessSignatureToken.Validate(sharedAccessSignature);
     this.sharedAccessSignature = sharedAccessSignature;
 }