Skip to content

401 unauthorized error on callback #21

Open
@hugofloss

Description

@hugofloss

I'm trying to connect through OAuth, but I'm having some difficulties with that. I have the following method in my controller (of course with a correct callback url):

def evernote_web_auth()
    client = EvernoteOAuth::Client.new
    request_token = client.request_token(oauth_callback: 'my_callback_url')

    request_token
  end

Following with this code to generate the the authorization url: evernote_web_auth().authorize_url. This works, and I can authorize with my sandbox account. After authorizing, I get redirected to the same controller that contains the following code:

request_token = evernote_web_auth()
access_token = request_token.get_access_token(oauth_verifier: params[:oauth_verifier])

This should work (like the guide explained). As you can see, it uses the same method as I used to generate the authorization url to perform .get_access_token on, but this time it results in a 401 - Unauthorized error.

My consumer key and secret are correct because I can generate the authorization url. So, what's wrong with the gem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions