WordPress.org

Forums

WP LinkedIn
[resolved] Your LinkedIn access token is invalid or has expired (15 posts)

  1. dme102
    Member
    Posted 1 year ago #

    Constantly being asked to get a new access token and after a few minutes being asked again.

    Tried getting a new token many times over and regenerating token, have allowed access many times. Still getting the nag in the dashboard.

    Info from LinkedIn is still showing up on front end. Just need to disable the nag.

    http://wordpress.org/plugins/wp-linkedin/

  2. dme102
    Member
    Posted 1 year ago #

    Any help on this?

    Still experiencing the issue. It is very annoying but I do not want to stop using the plugin as the recommendation feature is great.

  3. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, if you have the latest version of the plugin you should get an error message together with "invalid or expired token" message, do you?

  4. Marcio Rocha
    Member
    Posted 1 year ago #

    Hi Claude!
    I install plugin today and this error occur constantly.
    I click on regenerate, on clear cache, and error still occur.

    this is the message:
    "Your LinkedIn access token is invalid or has expired, please click here to get a new one."
    I click and I receive two messages (together):
    "Your LinkedIn access token is invalid or has expired, please click here to get a new one."
    ...and below...
    "The access token has been successfully updated."
    in page I put the shortcode [li_profile] and inf frontend this message occur:
    "There's something wrong and the profile could not be retreived, please check the list of profile fields to be fetched. If everything seems good try regenerating the access token."

    please help me

    Marcio

  5. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    what version of the plugin do you have?

  6. Marcio Rocha
    Member
    Posted 1 year ago #

    last version! I installed yestarday on my test environment.

  7. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    check the time on your server, LinkedIn gives back the token together with an expiry date and if the server's date and time are wrong it may think the token expiry is always in the past

  8. Marcio Rocha
    Member
    Posted 1 year ago #

    Hi Claude,

    The site is hosted on hosting company. I'm checking that the server is the correct time and date. But here in São Paulo / Brazil we are in summer time. Then the server is exactly 1 hour less compared to my local time.

    Thank you again

    Marcio

  9. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    time or daylight saving time don't matter in that case but if the server has a date set in future more than 60 days then it will calculate that the token is expired when it receives it.

    anyway, it doesn't seem like it's coming for that. can you give me an admin access to your install? use that contact page to send me the credentials http://vedovini.net/contact/

  10. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    any news here?

  11. doublesharp
    Member
    Posted 1 year ago #

    I am still having this issue - the token seems to last for about 30 seconds before expiring. Just checked the time and all is well, I did need to change my timezone from EST to PST but the Your LinkedIn access token is invalid or has expired, please click here to get a new one. message continues to appear.

  12. doublesharp
    Member
    Posted 1 year ago #

    Just did a bit of digging and get_transient('wp-linkedin_oauthtoken') is not returning a value. Suspecting that this is related to using transients along with Nginx, spawn-fcgi and APC.

  13. doublesharp
    Member
    Posted 1 year ago #

    I was able to get this to work for my by using options instead of transients (likely related to my using spawn-fcgi and APC). Storing the expiration as it's own entry so it can be checked for validity. Updated the following in class-linkedin-oauth.php.

    get_access_token()

    return apply_filters('linkedin_oauthtoken', get_option('wp-linkedin_oauthtoken'));

    invalidate_access_token()

    delete_option('wp-linkedin_oauthtoken');

    set_access_token()

    if (isset($body->access_token)) {
        update_option('wp-linkedin_invalid_token_mail_sent', false);
        update_option('wp-linkedin_oauthtoken', $body->access_token);
        update_option('wp-linkedin_expires', time()+$body->expires);
        return true;
    }

    is_access_token_valid()

    $token = get_option('wp-linkedin_oauthtoken');
    return (!empty($token) && get_option('wp-linkedin_expires') > time());
  14. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    In that case it means you have a problem with your cache configuration and that it's going to cause trouble in other places in WordPress

  15. Claude Vedovini
    Member
    Plugin Author

    Posted 1 year ago #

    closing

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.