0
resource = RestClient::Resource.new('http://protected/resource', 'user', 'pass')

I have seen the above link, when i am serchng for http basic authentication with ruby. But my question is how to retreive and decode this user and pass for the login purpose?

1
  • Sorry, what? "Retrieve and decode" the username and password? If you do not have the username and password, you're not supposed to access the protected resource in the first place...?! Commented Mar 7, 2012 at 7:22

1 Answer 1

1

If you're going to implement the server end with Rails, http_basic_authenticate_with is what you are looking for. See ActionController::HttpAuthentication::Basic

Sign up to request clarification or add additional context in comments.

1 Comment

i have passed like this resource = RestClient::Resource.new show_url,:user => user_name, :password => password

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.