开发者

mvc, oauth and google / yahoo contacts

I'm new to oAuth. What I need to do is a) the user logs in the site using default .net membership provider b) once he logs in he links his google/yahoo account ( what I understand is he gets a token access which should preferably never expire and I keep it in my db) c) the user can get his google/yahoo contacts (Name, email id and if possible a unique id for each contact) using the token access

I have created a google account and have the app id and secret key. I'm looking at dotnetopenauth samples, project templates and tools but it has lots of things and I would appreciate if someone can guide me on the right path. Thanks and best regard开发者_如何学JAVAs Arnab


The OAuthConsumer sample, GoogleAddressBook.aspx page, shows how to pull Google Contacts using OAuth. Note that although this sample is in web forms rather than MVC, the OAuth consumer code is entirely written in the code-behind and has no web forms-specific stuff in it, so it can be easily lifted and dropped into an MVC app without issue.

There is no equivalent Yahoo! sample that ships as part of DotNetOpenAuth.

Don't try to use the InMemoryTokenManager that the sample uses. Write your own ITokenManager implementation. The comments and docs will guide you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜