Tuesday, February 19, 2013

Talk:Facebook authentication in Windows Phone application

?

(One intermediate revision by one user not shown)
Line 57: Line 57:
??
?

could you help me and explain more about how i get the profile picture in you ResponseCallbackProfile<p style="text-align:right">[[User:Sarahpy|Sarahpy]] 07:26, 19 February 2013 (EET)</p>

?

could you help me and explain more about how i get the profile picture in you ResponseCallbackProfile<p style="text-align:right">[[User:Sarahpy|Sarahpy]] 07:26, 19 February 2013 (EET)</p>

?+
?+

== Somnathbanik - Facebook API changed ==

?+
?+

Hi Sarahpy,

?+
?+

The Facebook API? has updated and is getting some extra text in the Access Token after "&". Please open the function ResponseCallback_AccessToken from the code and Split the access token. Here is the code that I created for you.

?+
?+

? string[] splitAccessToken = responseString.Split(new Char[] { '=','&' });

?+

? ? ? ? ? ? ? ? ? ? ? ? ? ? string accessTokenString = splitAccessToken.GetValue(0).ToString();

?+

? ? ? ? ? ? ? ? ? ? ? ? ? ? string accessTokenValue = splitAccessToken.GetValue(1).ToString();

?+

? ? ? ? ? ? ? ? ? ? ? ? ? ? string accessTokenTemp = splitAccessToken.GetValue(2).ToString();<p style="text-align:right">[[User:Somnathbanik|Somnathbanik]] 07:58, 19 February 2013 (EET)</p>

?+
?+

== Somnathbanik - @Sarahpy? - Continue ==

?+
?+

string[] splitAccessToken = responseString.Split(new Char[] { '=','&' });

?+

string accessTokenString = splitAccessToken.GetValue(0).ToString();

?+

string accessTokenValue = splitAccessToken.GetValue(1).ToString();

?+

string accessTokenTemp = splitAccessToken.GetValue(2).ToString();<p style="text-align:right">[[User:Somnathbanik|Somnathbanik]] 08:01, 19 February 2013 (EET)</p>


Latest revision as of 08:01, 19 February 2013

Tapanila - Why you aren't using FacebookCsharpSDK?

There exists a very good Facebook C# SDK that works perfectly for Windows Phone. https://github.com/facebook-csharp-sdk/facebook-csharp-sdk

Why you aren't using it?

It's way easier to use.

Tapanila 13:09, 14 August 2012 (EEST)

Hamishwillee - This article states "without using any third party library."

Hi Tapanila

Thanks for pointing this out. Obviously its a good idea to use a well maintained third party library provided cost and licencing permit. Perhaps the author didn't know about this library, or wanted to remove a dependency on any third party library, or perhaps they thought that showing how it is done would be useful for some users.

In any case, the article states that it is for use if you don't want to use a third party library, and is therefore accurate.

That said I have added a note near the top suggesting this library. Is this a "defacto standard" - or are there other competitive C# libraries you know about?

Regards

Hamish

hamishwillee 06:44, 15 August 2012 (EEST)

Spaced Sweden - I would do as the author if its only authentication you are after

But there is a problem with this solution, you will be shipping your api key and secret wich is really easy to sniff, and that is a secuirty flaw

what you should do is to add &response_type=token to "https://www.facebook.com/dialog/oauth?client_id=<Your Key>&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=email,user_location,friends_location,user_hometown,friends_hometown,publish_stream,offline_access,read_stream,user_status,user_photos,friends_photos,friends_status,user_checkins,friends_checkins,user_events,publish_checkins&display=touch

By adding response_type you never have to send you secret from a phone and you are saving one request wich is nice.

Worth noting is that WAP is not a valid display type any more.

Regarding 3rd party libs, i would just stick with my own if its only user auth you are after.

Have fun

spaced_Sweden 10:19, 16 August 2012 (EEST)

Somnathbanik - Hi friends

Hi Friends,

@Tapanila?: I would like to echo what Hamish said. I knew about the Facebook C# SDK, and have tried that, also got few examples on web using that SDK. Cause of that I thought of writing an article that authenticates without using any third party library.

@spaced_Sweden ?: First of all welcome to Nokia Developer Community.

This is a technique alternative of the available 3rd party library. Regarding permission and display you can always go to facebook developer web site for more updated information, like offline_access doesn't support now, but has no harm here, same with display also?:)

somnathbanik 13:32, 16 August 2012 (EEST)

Sarahpy - I cannot get the profile picture to show up after logged in

after try your code

i can login successfully

and the username is show up

but the profile picture didn't show

could you help me and explain more about how i get the profile picture in you ResponseCallbackProfile

sarahpy 07:26, 19 February 2013 (EET)

Somnathbanik - Facebook API changed

Hi Sarahpy,

The Facebook API has updated and is getting some extra text in the Access Token after "&". Please open the function ResponseCallback_AccessToken from the code and Split the access token. Here is the code that I created for you.

 string[] splitAccessToken = responseString.Split(new Char[] { '=','&' });                            string accessTokenString = splitAccessToken.GetValue(0).ToString();                            string accessTokenValue = splitAccessToken.GetValue(1).ToString(); 
string accessTokenTemp = splitAccessToken.GetValue(2).ToString();

somnathbanik 07:58, 19 February 2013 (EET)

Somnathbanik - @Sarahpy - Continue

string[] splitAccessToken = responseString.Split(new Char[] { '=','&' }); string accessTokenString = splitAccessToken.GetValue(0).ToString(); string accessTokenValue = splitAccessToken.GetValue(1).ToString(); 
string accessTokenTemp = splitAccessToken.GetValue(2).ToString();

somnathbanik 08:01, 19 February 2013 (EET)

Source: http://www.developer.nokia.com/Community/Wiki/index.php?title=Talk:Facebook_authentication_in_Windows_Phone_application&diff=183988&oldid=183986

K Michelle roger clemens multiple sclerosis falling skies rodney king Webb Simpson Fathers Day Quotes

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.