Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where did :verify_oauth_consumer_signature go? #135

Open
alextoul opened this issue Feb 12, 2013 · 0 comments
Open

Where did :verify_oauth_consumer_signature go? #135

alextoul opened this issue Feb 12, 2013 · 0 comments

Comments

@alextoul
Copy link

I'm not sure I followed the latest changes properly but I've been using this plugin for over a year and use :verify_oauth_consumer_signature on all the controllers I wanted to secure.

It worked fine till our latest upgrade and now it seemed that we should be using :oauth_required but we can't get it to work.

Any idea how we can get the same behaviour than :verify_oauth_consumer_signature ?

Update: I got it to work by redefining verify_oauth_consumer_signature in our application controller. Is that safe?

def verify_oauth_consumer_signature
begin
valid = ClientApplication.verify_request(request) do |request_proxy|
@current_client_application = ClientApplication.find_by_key(request_proxy.consumer_key)

     # Store this temporarily in client_application object for use in request token generation 
     @current_client_application.token_callback_url=request_proxy.oauth_callback if request_proxy.oauth_callback

     # return the token secret and the consumer secret
     [nil, @current_client_application.secret]
   end
 rescue
   valid=false
 end

 invalid_oauth_response unless valid

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant