none
How to use Web Authentication Broker in Windows phone 8.1

    Question

  • Hi,

    i'm making app that require user to login via Google to access the Google service (oAuth2). It is easy to WebAuthenticationBroker in Windows 8.1 but it is complicated in Windows Phone 8.1. I got sample project from MSDN sample code. But it is very complex one, i didn't even understand because that consist of many web services (Facebook, twitter, Google, live etc.). Please can any one help me to use Web Authentication Broker in windows phone 8.1. I can provide you my project. You can check.. Please I need help. I tried lot but didn't get success. i need to make this Web Authentication for Google service only...

    My project can be downloaded from one drive: My Web Authentication project

    That Project contain piece of code of Web Authentication Broker, it will execute login screen (Google login service) when button clicked, but the problem i'm not getting response data or authorization code from Web Authentication Broker.. Please help me..

    Thank you...



    • Edited by Ashiq Hassan Saturday, September 27, 2014 5:55 PM
    Saturday, September 27, 2014 5:49 PM

Answers

  • Hi Ashiq,

    I downloaded your project and looked into it, I guess the problem you are facing is don't know how to step into ContinueWebAuthentication() method.

    If you read the documentation carefully: Quickstart: Connecting to an online identity provider (Phone), you should be able to read following part and this is the part you are missing:

    Authentication on  Windows Phone 8.1 is handled differently than it is on Windows 8.1. Because connecting to an online identity provider can be a memory-intensive process, the system suspends your app for the duration of the authentication operation. On lower-memory devices, your app might even be terminated. When the operation completes, your app is automatically reactivated and the authentication results returned as part of your app's Application.OnActivated event args. In order to effectively suspend, reactivate, and continue your app after calling AuthenticateAndContinue, the use of two special helper classes —SuspensionManager and ContinuationManager— is required. To learn how to use these classes, see How to continue your Windows Phone Store app after calling an AndContinue method. Then proceed to the next step.

    We should continue our app after a AndContinue() method, if you don't implement that, you will always see the login button and that's why you think WAB does not work with your app.

    Could you try to implement this, if you still have problem, please feel free to ask :)

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Ashiq Hassan Monday, September 29, 2014 6:27 PM
    Monday, September 29, 2014 8:49 AM

All replies

  • I didn't get any answer yet... Please help me
    Sunday, September 28, 2014 9:54 AM
  • Hi Ashiq,

    Any problem when you implement the WAB feature? You already have the code from code center but what kind of problem you meet when removing the FaceBook twitter api?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Sunday, September 28, 2014 10:16 AM
  • I tried, But I'm getting error.. That's why i provided my project...Please help me bro..
    Sunday, September 28, 2014 2:08 PM
  • Hi Ashiq,

    I downloaded your project and looked into it, I guess the problem you are facing is don't know how to step into ContinueWebAuthentication() method.

    If you read the documentation carefully: Quickstart: Connecting to an online identity provider (Phone), you should be able to read following part and this is the part you are missing:

    Authentication on  Windows Phone 8.1 is handled differently than it is on Windows 8.1. Because connecting to an online identity provider can be a memory-intensive process, the system suspends your app for the duration of the authentication operation. On lower-memory devices, your app might even be terminated. When the operation completes, your app is automatically reactivated and the authentication results returned as part of your app's Application.OnActivated event args. In order to effectively suspend, reactivate, and continue your app after calling AuthenticateAndContinue, the use of two special helper classes —SuspensionManager and ContinuationManager— is required. To learn how to use these classes, see How to continue your Windows Phone Store app after calling an AndContinue method. Then proceed to the next step.

    We should continue our app after a AndContinue() method, if you don't implement that, you will always see the login button and that's why you think WAB does not work with your app.

    Could you try to implement this, if you still have problem, please feel free to ask :)

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Ashiq Hassan Monday, September 29, 2014 6:27 PM
    Monday, September 29, 2014 8:49 AM
  • Although i got answer from other source. He helped me well..
    Anyway thank you for replay.....

    How to use the WebAuthenticationBroker for oAuth in a Windows Phone Runtime WP8.1 app

    Monday, September 29, 2014 6:25 PM