c# - LinkedIn "The token used in the OAuth request is not valid. consumer Key: 'value of consumer key' " -


i have application in asp.net c#. in can post , post posted on users own linkedin account. getting exception

the token used in oauth request not valid. consumer key:consumer key value responsereader = new streamreader(webrequest.getresponse().getresponsestream());

what meaning of exception?

note: setting client api key consumer key , webrequest header contains

oauth_token,realm,oauth_consumer_key,oauth_signature_method,oauth_token_secret, `oauth_signature`, `oauth_timestamp`, `oauth_nonce`, `oauth_verifier`, `oauth_version=1.0` 


but verifier , token secret blank.

what should do?

there can various events can cause access token become invalid:

1. life of access token expires: generally, lifetime of linkedin access token 60 days. in case time period elapsed, access token expires , becomes invalid.

2. user revokes permissions application linkedin.com: if user has revoked permissions application, access token becomes invalid.

in both cases, application needs take user through authorization flow again.

also verify access token using api call valid token.

for reference: https://developer-programs.linkedin.com/documents/handling-errors-invalid-tokens


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -