Exemple #1
0
 public static string ComputeSimpleWebTokenString(string issuerName, string issuerSecret)
 {
     if (string.IsNullOrEmpty(issuerName))
     {
         throw new ArgumentException(SRClient.NullIssuerName, "issuerName");
     }
     if (string.IsNullOrEmpty(issuerSecret))
     {
         throw new ArgumentException(SRClient.NullIssuerSecret, "issuerSecret");
     }
     byte[] numArray = null;
     try
     {
         numArray = Convert.FromBase64String(issuerSecret);
     }
     catch (FormatException formatException)
     {
         throw new ArgumentException(SRClient.InvalidIssuerSecret, "issuerSecret");
     }
     return(SharedSecretTokenProvider.ComputeSimpleWebTokenString(issuerName, numArray));
 }
Exemple #2
0
 internal SharedSecretTokenProvider(string issuerName, string issuerSecret, Uri stsUri, Microsoft.ServiceBus.TokenScope tokenScope) : this(issuerName, SharedSecretTokenProvider.DecodeSecret(issuerSecret), stsUri, tokenScope)
 {
 }
Exemple #3
0
 internal SharedSecretTokenProvider(string issuerName, string issuerSecret) : this(issuerName, SharedSecretTokenProvider.DecodeSecret(issuerSecret), Microsoft.ServiceBus.TokenScope.Entity)
 {
 }
Exemple #4
0
        protected override IAsyncResult OnBeginGetWebToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state)
        {
            base.ValidateAction(action);
            Uri stsUri = TokenProviderHelper.GetStsUri(this.stsUri, appliesTo);

            TokenProviderHelper.TokenResult <string> httpAuthAccessTokenByAssertion = TokenProviderHelper.GetHttpAuthAccessTokenByAssertion(stsUri, appliesTo, SharedSecretTokenProvider.ComputeSimpleWebTokenString(this.issuerName, this.issuerSecret), "SWT", timeout);
            return(new CompletedAsyncResult <TokenProviderHelper.TokenResult <string> >(httpAuthAccessTokenByAssertion, callback, state));
        }