protected override IAsyncResult OnBeginGetToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state) { DateTime dateTime; string str; string oAuthAccessTokenCore = TokenProviderHelper.GetOAuthAccessTokenCore(this.stsUris.GetEnumerator(), this.onBuildUri, this.BuildRequestToken(appliesTo), timeout, out dateTime, out str); SimpleWebSecurityToken simpleWebSecurityToken = new SimpleWebSecurityToken(oAuthAccessTokenCore, dateTime, str); TokenProviderHelper.TokenResult <SecurityToken> tokenResult = new TokenProviderHelper.TokenResult <SecurityToken>() { CacheUntil = dateTime, Token = simpleWebSecurityToken }; return(new CompletedAsyncResult <TokenProviderHelper.TokenResult <SecurityToken> >(tokenResult, callback, state)); }
protected override IAsyncResult OnBeginGetWebToken(string appliesTo, string action, TimeSpan timeout, AsyncCallback callback, object state) { DateTime dateTime; string str; string oAuthAccessTokenCore = TokenProviderHelper.GetOAuthAccessTokenCore(this.stsUris.GetEnumerator(), this.onBuildUri, this.BuildRequestToken(appliesTo), timeout, out dateTime, out str); CultureInfo invariantCulture = CultureInfo.InvariantCulture; object[] objArray = new object[] { "WRAP", "access_token", oAuthAccessTokenCore }; string str1 = string.Format(invariantCulture, "{0} {1}=\"{2}\"", objArray); TokenProviderHelper.TokenResult <string> tokenResult = new TokenProviderHelper.TokenResult <string>() { CacheUntil = dateTime, Token = str1 }; return(new CompletedAsyncResult <TokenProviderHelper.TokenResult <string> >(tokenResult, callback, state)); }