i have 2 portal, one and two. The portal one have all apis, and the portal
Two have the interfaces, Here just i am doing enter the username and
password in the login page so that will go the method of Portal Two. Then
it will pass the username and password of a method of Portal One, this is
am doing here. My question is how to do the basic authorization for encrypt
the username and password

res = RestClient::Resource.new url, :user_name => params[:name],
:password => params[:password]
response = res.post :content_type => :json, :accept => :json

Bcz now here the username and password is plain text. How to do the Basic
Authorization here...Any help would be appreciated: please give one
clarification of that.

Thanks
vi

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ce3C55EsSaIJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Alpha Blue at Mar 6, 2012 at 2:29 pm
    Well for starters you could use an authentication solution like Devise.

    Or, you could create your own solution like so:

    https://gist.github.com/1986547

    This is just a simple custom solution I created. I also went back and
    built my own image verification system and tied it into this custom
    solution.

    But, I provided you the basics for handling authentication.

    In my DB schema, my password field is called :password_digest. You
    could feasibly name your password field in your DB to anything you
    wanted. You just have to edit the methods I provided in the gist.

    I also copied much of this initial code right from Rails when I first
    started using Bcrypt.

    I hope that helps get you started.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Amvis at Mar 7, 2012 at 5:37 am

    On Tuesday, 6 March 2012 19:59:19 UTC+5:30, Ruby-Forum.com User wrote:
    Well for starters you could use an authentication solution like Devise.
    Or, you could create your own solution like so:
    https://gist.github.com/1986547
    This is just a simple custom solution I created. I also went back and
    built my own image verification system and tied it into this custom
    solution.
    basically my doubt is the HTTP BASIC authentications says.. Example..if
    the username is "user" and password is "password". "user:password" it will
    converted into via basic64 ecoding, then we will get like this

    *Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==*


    So, if i pass the username and password via restclient like this


    * res = RestClient::Resource.new url, :user_name => params[:name], :password => params[:password].* it will automatically convert into this format


    *Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==*

    *
    *

    *....?????*


    Plz give me a solution, i have been searching this doubt for 3 days....



    But, I provided you the basics for handling authentication.
    In my DB schema, my password field is called :password_digest. You
    could feasibly name your password field in your DB to anything you
    wanted. You just have to edit the methods I provided in the gist.
    I also copied much of this initial code right from Rails when I first
    started using Bcrypt.
    I hope that helps get you started.
    --
    Posted via http://www.ruby-forum.com/.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/tV8Uz4kwHigJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 6, '12 at 8:16a
activeMar 7, '12 at 5:37a
posts3
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Amvis: 2 posts Alpha Blue: 1 post

People

Translate

site design / logo © 2021 Grokbase