Authentication Error AndContinue WP 8.1

I am trying to authenticate on Windows Phone 8.1 using the AuthenticateAndContinue method for the WebAuthenticationBroker. This is the page where I authenticate.

public sealed partial class ScenarioFrame : Page,IWebAuthenticationContinuable
{
    public static ScenarioFrame Current;
    public ScenarioFrame()
    {
        this.InitializeComponent();
        Current = this;
        Load();
    }

    /// <summary>
    /// Invoked when this page is about to be displayed in a Frame.
    /// </summary>
    /// <param name="e">Event data that describes how this page was reached.
    /// This parameter is typically used to configure the page.</param>
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
        Load();
    }
    private void Load()
    {
        WebAuthenticationBroker.AuthenticateAndContinue(new Uri("https://manage.windowsazure.com/publishsettings/"),new Uri("https://manage.windowsazure.com/publishsettings/getpublishsettings"));
        Block.Visibility = Visibility.Visible;
    }
    public async void ContinueWebAuthentication(Windows.ApplicationModel.Activation.WebAuthenticationBrokerContinuationEventArgs args)
    {
        String resp = args.WebAuthenticationResult.ResponseData;
    }
}

      

I used the ContinuationManager and SuspensionManager available on MSDN to use the AndContinueMethod. The application navigates to the ScenarioFrame when the user clicks a button in the MainPage. The problem is that the WebAuthenticationResult after the callback gives an error in the WebAuthenticationStatus (UserCancel) property and the response is null. This issue does not occur in a Windows 8.1 app where I am using the AuthenticateAsync method. Can anyone elaborate on how to resolve this issue?

+3


source to share


1 answer


WebAuthenticationBroker.AuthenticateAndContinue(new Uri("https://manage.windowsazure.com/publishsettings/"), new Uri("https://manage.windowsazure.com/publishsettings/getpublishsettings"),   null, WebAuthenticationOptions.None);

      



try it

+1


source







All Articles