我试图在使用AAD B2C的Xamarin.Forms应用程序中设置一个刷新令牌。当我拨打我的MobileServiceClient
上的LoginAsync
时,我已经设置了一切,但遇到问题。所有的docs和例子我能找到演出来更新我的LoginAsync
方法是:在AAD B2C中使用刷新令牌与Azure App Service和Xamarin.Forms
var user = await App.MobileServiceClient.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory,
new Dictionary<string, string>() { { "response_type", "code id_token" } });
除将MobileServiceClient
不采取Dictionary<string, string>
第二个参数。这需要JObject
。这里是我当前的代码是什么样子:
var authResult = await App.AuthenticationClient.AcquireTokenAsync(Constants.Scopes, "", UiOptions.SelectAccount, string.Empty, null, Constants.Authority, Constants.Policy);
var payload = new JObject();
payload["access_token"] = authResult.Token;
var user = await App.MobileServiceClient.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory, payload);
我无法找到一个例子使用JObject
任何地方。
这与将payload["response_type"] = "code id_token";
添加到我的有效载荷一样简单?
你解决了这个问题吗,你需要进一步的帮助吗? –