/// <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));
        }
コード例 #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="action">The request action</param>
 /// <param name="timeout">The time span that specifies the timeout value for the message that gets the security token</param>
 /// <returns></returns>
 public Task <SecurityToken> GetTokenAsync(string appliesTo, string action, TimeSpan timeout)
 {
     TimeoutHelper.ThrowIfNegativeArgument(timeout);
     appliesTo = this.NormalizeAppliesTo(appliesTo);
     return(this.OnGetTokenAsync(appliesTo, action, timeout));
 }