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; }
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; }
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; }
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; }
internal SharedSecretTokenProvider(string issuerName, string issuerSecret, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) : this(issuerName, SharedSecretTokenProvider.DecodeSecret(issuerSecret), stsUri, tokenScope) { }
public static TokenProvider CreateSimpleWebTokenProvider(string token, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) { return(new SimpleWebTokenProvider(token, stsUri, tokenScope)); }
public static TokenProvider CreateSharedSecretTokenProvider(string issuerName, byte[] issuerSecret, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) { return(new SharedSecretTokenProvider(issuerName, issuerSecret, stsUri, tokenScope)); }
public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive, Microsoft.ServiceBus.TokenScope tokenScope) { return(new SharedAccessSignatureTokenProvider(keyName, sharedAccessKey, tokenTimeToLive, tokenScope)); }
public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, Microsoft.ServiceBus.TokenScope tokenScope) { return(new SharedAccessSignatureTokenProvider(keyName, sharedAccessKey, TokenProvider.DefaultTokenTimeout, tokenScope)); }
public static TokenProvider CreateSamlTokenProvider(string samlToken, Uri stsUri, int cacheSize, Microsoft.ServiceBus.TokenScope tokenScope) { return(new SamlTokenProvider(samlToken, stsUri, tokenScope) { CacheSize = cacheSize }); }
public static TokenProvider CreateSamlTokenProvider(string samlToken, Microsoft.ServiceBus.TokenScope tokenScope) { return(new SamlTokenProvider(samlToken, tokenScope)); }
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; }