locked
[UWP]No Continuation in WP10 Apps RRS feed

  • Question

  • Hello All,

    I'm having trouble porting the demo posted on MVA concerning Developing Universal Windows Apps with C# and XAML to Windows Phone 10.  I have a Universal Windows Application for Win 10, but I noticed that on the AuthenticationContext class, there is no more ContinuationX methods as described by Jerry in the MVA training.  This is a GAP that I hope someone can help fill.  Below are all the links and references to what I'm speaking about. 

    REF: https://mva.microsoft.com/en-US/training-courses/developing-universal-windows-apps-with-c-and-xaml-8363?l=yNkg1EGz_8604984382

    GO TO MINUTE 32:43

    AuthenticationContext Class: https://msdn.microsoft.com/en-us/library/microsoft.identitymodel.tokens.authenticationcontext.aspx


    - Rashad Rivera www.omegusprime.com


    Wednesday, September 14, 2016 11:01 PM

Answers

  • You're looking at a Windows 8.1 video. It's out of date for UWP apps.

    The continuation model from Windows Phone 8.1 was removed for UWP apps. UWP apps regardless of target device will call WebAuthenticationBroker.AuthenticateAsync (&c.) rather than AuthenticateAndContinue.

    You can probably just delete the #if WINDOWS_PHONE section from AdalService.cs and always use the #elif WINDOWS_APP code.

    • Proposed as answer by Barry Wang Wednesday, September 28, 2016 1:15 PM
    • Marked as answer by Barry Wang Friday, September 30, 2016 5:55 AM
    Wednesday, September 14, 2016 11:58 PM
  • The Windows documentation does because the methods still exist but shouldn't be called (and don't do anything)

    In addition to AuthenticateAsync, the Windows.Security.Authentication.Web namespace contains an AuthenticateAndContinue method. Do not call this method. It is designed for apps targeting Windows Phone 8.1 only and is deprecated starting with Windows 10.

    For the Azure Active Directory libraries (ADAL) I believe you'll use a different version so the methods just won't exist. For more details on the ADAL libraries please ask in the ADAL forums. Note that the AuthorizationContext docs that you linked are very old and not applicable here.

    • Proposed as answer by Barry Wang Wednesday, September 28, 2016 1:15 PM
    • Marked as answer by Barry Wang Friday, September 30, 2016 5:55 AM
    Thursday, September 15, 2016 1:57 AM

All replies

  • ALL,

    It is worth mentioning that Jerry is using the following method in the demo.  The Context variable is of type AuthenticationContext. 

    REF: http://xaml.codeplex.com/SourceControl/latest#MVA/201410_UniversalApp/Dispatchr.Client/Dispatchr.Client.Shared/Services/AdalService/AdalService.cs

    public async void Continuation(IWebAuthenticationBrokerContinuationEventArgs args)
            {
                if (Context == null)
                    throw new NullReferenceException("Context is null");
                await Context.ContinueAcquireTokenAsync(args);
            }


    - Rashad Rivera www.omegusprime.com


    • Edited by Rashad Rivera Wednesday, September 14, 2016 11:07 PM Fix formatting
    Wednesday, September 14, 2016 11:06 PM
  • You're looking at a Windows 8.1 video. It's out of date for UWP apps.

    The continuation model from Windows Phone 8.1 was removed for UWP apps. UWP apps regardless of target device will call WebAuthenticationBroker.AuthenticateAsync (&c.) rather than AuthenticateAndContinue.

    You can probably just delete the #if WINDOWS_PHONE section from AdalService.cs and always use the #elif WINDOWS_APP code.

    • Proposed as answer by Barry Wang Wednesday, September 28, 2016 1:15 PM
    • Marked as answer by Barry Wang Friday, September 30, 2016 5:55 AM
    Wednesday, September 14, 2016 11:58 PM
  • Rob,

    I figured as much.  Any idea why the Microsoft documentation does not mention the removal of these functions? 


    - Rashad Rivera www.omegusprime.com

    Thursday, September 15, 2016 1:20 AM
  • The Windows documentation does because the methods still exist but shouldn't be called (and don't do anything)

    In addition to AuthenticateAsync, the Windows.Security.Authentication.Web namespace contains an AuthenticateAndContinue method. Do not call this method. It is designed for apps targeting Windows Phone 8.1 only and is deprecated starting with Windows 10.

    For the Azure Active Directory libraries (ADAL) I believe you'll use a different version so the methods just won't exist. For more details on the ADAL libraries please ask in the ADAL forums. Note that the AuthorizationContext docs that you linked are very old and not applicable here.

    • Proposed as answer by Barry Wang Wednesday, September 28, 2016 1:15 PM
    • Marked as answer by Barry Wang Friday, September 30, 2016 5:55 AM
    Thursday, September 15, 2016 1:57 AM