internal SimpleWebTokenProvider(string simpleWebToken, Microsoft.ServiceBus.TokenScope tokenScope) : base(true, true, tokenScope)
 {
     if (string.IsNullOrEmpty(simpleWebToken))
     {
         throw new ArgumentException(SRClient.NullSimpleWebToken, "simpleWebToken");
     }
     this.simpleWebToken = simpleWebToken;
     this.stsUri         = null;
 }
示例#2
0
 protected TokenProvider(bool cacheTokens, bool supportHttpAuthToken, int cacheSize, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     if (cacheSize < 1)
     {
         throw new ArgumentOutOfRangeException("cacheSize", SRClient.ArgumentOutOfRangeLessThanOne);
     }
     this.TokenScope          = tokenScope;
     this.cacheSize           = cacheSize;
     this.CacheTokens         = cacheTokens;
     this.isWebTokenSupported = supportHttpAuthToken;
     this.retrySleepTime      = TokenProvider.InitialRetrySleepTime;
 }
示例#3
0
 internal SharedSecretTokenProvider(string issuerName, byte[] issuerSecret, Microsoft.ServiceBus.TokenScope tokenScope) : base(true, true, tokenScope)
 {
     if (string.IsNullOrEmpty(issuerName))
     {
         throw new ArgumentException(SRClient.NullIssuerName, "issuerName");
     }
     if (issuerSecret == null || (int)issuerSecret.Length == 0)
     {
         throw new ArgumentException(SRClient.NullIssuerSecret, "issuerSecret");
     }
     this.issuerName   = issuerName;
     this.issuerSecret = issuerSecret;
     this.stsUri       = null;
 }
 internal SimpleWebTokenProvider(string simpleWebToken, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) : base(true, true, tokenScope)
 {
     if (string.IsNullOrEmpty(simpleWebToken))
     {
         throw new ArgumentException(SRClient.NullSimpleWebToken, "simpleWebToken");
     }
     if (stsUri == null)
     {
         throw new ArgumentNullException("stsUri");
     }
     if (!stsUri.AbsolutePath.EndsWith("/", StringComparison.Ordinal))
     {
         throw new ArgumentException(SRClient.STSURIFormat);
     }
     this.simpleWebToken = simpleWebToken;
     this.stsUri         = stsUri;
 }
示例#5
0
 internal SharedSecretTokenProvider(string issuerName, byte[] issuerSecret, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) : base(true, true, tokenScope)
 {
     if (string.IsNullOrEmpty(issuerName))
     {
         throw new ArgumentException(SRClient.NullIssuerName, "issuerName");
     }
     if (issuerSecret == null || (int)issuerSecret.Length == 0)
     {
         throw new ArgumentException(SRClient.NullIssuerSecret, "issuerSecret");
     }
     if (stsUri == null)
     {
         throw new ArgumentNullException("stsUri");
     }
     if (!stsUri.AbsolutePath.EndsWith("/", StringComparison.Ordinal))
     {
         throw new ArgumentException(SRClient.STSURIFormat, "stsUri");
     }
     this.issuerName   = issuerName;
     this.issuerSecret = issuerSecret;
     this.stsUri       = stsUri;
 }
示例#6
0
 internal SharedSecretTokenProvider(string issuerName, string issuerSecret, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) : this(issuerName, SharedSecretTokenProvider.DecodeSecret(issuerSecret), stsUri, tokenScope)
 {
 }
示例#7
0
 public static TokenProvider CreateSimpleWebTokenProvider(string token, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     return(new SimpleWebTokenProvider(token, stsUri, tokenScope));
 }
示例#8
0
 public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, byte[] issuerSecret, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     return(new SharedSecretTokenProvider(issuerName, issuerSecret, stsUri, tokenScope));
 }
示例#9
0
 public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     return(new SharedAccessSignatureTokenProvider(keyName, sharedAccessKey, tokenTimeToLive, tokenScope));
 }
示例#10
0
 public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     return(new SharedAccessSignatureTokenProvider(keyName, sharedAccessKey, TokenProvider.DefaultTokenTimeout, tokenScope));
 }
示例#11
0
 public static TokenProvider CreateSamlTokenProvider(string samlToken, Uri stsUri, int cacheSize, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     return(new SamlTokenProvider(samlToken, stsUri, tokenScope)
     {
         CacheSize = cacheSize
     });
 }
示例#12
0
 public static TokenProvider CreateSamlTokenProvider(string samlToken, Microsoft.ServiceBus.TokenScope tokenScope)
 {
     return(new SamlTokenProvider(samlToken, tokenScope));
 }
示例#13
0
 protected TokenProvider(bool cacheTokens, bool supportHttpAuthToken, Microsoft.ServiceBus.TokenScope tokenScope) : this(cacheTokens, supportHttpAuthToken, 1000, tokenScope)
 {
 }
 internal SharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive, Microsoft.ServiceBus.TokenScope tokenScope) : base(true, true, tokenScope)
 {
     if (string.IsNullOrEmpty(keyName))
     {
         throw new ArgumentNullException("keyName");
     }
     if (keyName.Length > 256)
     {
         throw new ArgumentOutOfRangeException("keyName", SRCore.ArgumentStringTooBig("keyName", 256));
     }
     if (string.IsNullOrEmpty(sharedAccessKey))
     {
         throw new ArgumentNullException("sharedAccessKey");
     }
     if (sharedAccessKey.Length > 256)
     {
         throw new ArgumentOutOfRangeException("sharedAccessKey", SRCore.ArgumentStringTooBig("sharedAccessKey", 256));
     }
     this.encodedSharedAccessKey = Encoding.UTF8.GetBytes(sharedAccessKey);
     this.keyName         = keyName;
     this.tokenTimeToLive = tokenTimeToLive;
 }