I am writing an app to mine information from LinkedIn. I've only found one code sample thus far on oAuth. I'm having trouble understanding the workflow of oAuth, for example:
Username/Password
combination to log into LinkedIn and return a token, but in my case, I will always use the same LinkedIn Account.Since I'm always going to be using the same user to access the LinkedIn API, is there a way to do it so I don't have to re-enter the user name and password for every access request? The facebook API allows me to set the Token to not expire, thereby allowing me to save this token as an Attribute
inside my application).
The idea is :
How do I do this in C#?
You first need to determine the member token, and the corresponding OAuth token -- you could do this as a one off, and LinkedIn have some quite good documentation about authorizing (along with links to tools to verify, and to libraries that you can use to simplyify matters)
Once you have those, it's just a case of storing them "somewhere safe" - there is even a clause in the LinkedIn APIs Terms of Use that permits storage:
You may store the Member Token and the OAuth Token until the earlier of:
- Your ceasing using the APIs;
- The LinkedIn user uninstalls your application or directs you to delete the user's information; or,
- We terminate your use of them for breach of these Terms.
Just to be exceptionally clear - what you need to store on your system is the OAuth access token for that member. So you will need to store that token along with the userID (just so you can remember who that token belongs to). That token, along with your API key and secret, should give you the ability to call the linkedin services.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With