Authentication using Facebook C# SDK
How can I authenticate with a开发者_运维百科 username(email) and password? The samples provided just calls "authorizer.Authorize()" without credentials (which simply throws an "Invalid URI" format exception for me). Do I need an accessToken and if so, how do I get one?
You cannot authenticate with a username and password. You must use OAuth to authenticate a user. Facebook does not permit application developers to collect usernames and password from users.
This tutorial should help you: Getting Started with the Facebook C# SDK
I am not sure what you are trying to do exactly. But here is my experience and my knowledge of authentication.
In order to authenticate a user, you need a facebook application (specifically app id and server code), the user has to input their username and password and allows your app to access their data.
This authorization process will generate an access token that will your facebook app to access the user info. Note that this access_token expires often and in which case you need to authenticate again.
http://developers.facebook.com/docs/authentication/
Follow this youtube link and you might understand how you will get authenticated using ur website. this will redirect you to facebook where you have to log in, so if you want a random user on ur site to authenticate they will be redirected to facebook log in if u use the code from this example:
Facebook Auth Example
Hope this is what your looking for m8!
精彩评论