none
Facebook Login

    Question

  • Hi,

    I need to login into facebook from metro App.

    I am able to do so by as :

    private const string FACEBOOK = "https://www.facebook.com/dialog/oauth";

    String FacebookURL = "https://www.facebook.com/dialog/oauth?client_id=" + Uri.EscapeDataString(FACEBOOK_APPID) + "&redirect_uri=" + Uri.EscapeDataString(FACEBOOK) + "&scope=read_stream&display=popup&response_type=token"; System.Uri StartUri = new Uri(FacebookURL); System.Uri EndUri = new Uri(FACEBOOK); WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, StartUri, EndUri);


    I get authentication result as success and I am returned a AccessToken. But How do I persist this state. And How do I use the access token further.

    Regards

    Lalit

    Wednesday, October 03, 2012 11:43 AM

Answers

  • In object that represent the Session, maybe you need to create it and save it in settings.

    Sara Silva

    Wednesday, October 03, 2012 12:43 PM
  • Facebook has changed its rule for offline-access-token.

    Now there are 2 kinds of token that you can get from Facebook (just like the code you posted) : short-live & long-live token

    short-live token will expire after few hours but long-live token will expire after 60 days.

    Even you get the short-live token, you still can exchange it with Facebook to get the long-live token.

    So, all you need to do is get the long-live token and save it until it expires.

    You can refer to below link for detail.

    http://developers.facebook.com/roadmap/offline-access-removal/

    Ps. In Scenario 4, it tells how to exchange token



    Thursday, October 04, 2012 5:26 AM

All replies