Last post Dec 13, 2014 10:58 AM by Claudio7810
Dec 11, 2014 12:50 PM|Claudio7810|LINK
i am trying hard to have the code posted on http://blogs.msdn.com/b/webdev/archive/2013/10/16/get-more-information-from-social-providers-used-in-the-vs-2013-project-templates.aspx work.
I have made other posts with no luck at all. This is not actually a duplicate because I am following a different approach. I am used to use VB.net but this time I am using C#.
When I add the following code taken from the tutorial above into my Startup.Auth.cs the system gives me the following warning message:
method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
The code is:
var x = new FacebookAuthenticationOptions();
x.AppId = "xxxxxxxxxxxxxxx";
x.AppSecret = "xxxxxxxxxxxxxxxx";
x.Provider = new FacebookAuthenticationProvider()
OnAuthenticated = async context =>
//Get the access token from FB and store it in the database and
//use FacebookC# SDK to get more information about the user
x.SignInAsAuthenticationType = DefaultAuthenticationTypes.ExternalCookie;
Where is the problem in your opinion?
Dec 12, 2014 02:01 AM|Summer - MSFT|LINK
About the exception message, what I could do is provide some similar threads to you and hope them could helpful for you.
Dec 13, 2014 10:58 AM|Claudio7810|LINK
Thank you Summer,
unfortunately for me I am giving up with OWIN and Oauth 2.0.
I'll need to find an alternative way in order to retrieve additional data from Facebook (more than the email) and store it into the database.
There is no documentation at all on how to add custom Facebook claims and store them into database with WebForms projects. When I port the
http://blogs.msdn.com/b/webdev/archive/2013/10/16/get-more-information-from-social-providers-used-in-the-vs-2013-project-templates.aspx code from C# to VB and adapt it to WebForms, many errors are generated and honestly the code is something that should
be better explained and supported by examples for all platforms and not only MVC. By the way, not even the "working example" in https://github.com/rustd/FBLogin works
so I guess that I will need to wait for more examples or books about this topic and it looks like this system is still too much new and that needs many improvements from all aspects.