Basic authentication with WEBrick?

Discussion in 'Ruby' started by vasudevram, Sep 6, 2006.

  1. vasudevram

    vasudevram Guest

    Hi,

    We are using WEBrick on port 80 for development of a Rails app. [We may
    move to Mongrel or some other option later].

    Assume our host is http://my.host.com.

    When we go to http://my.host.com, we get our Rails app's first page
    shown correctly.
    At this page we will have a login form with username and password.

    But we also want to have one more level of authentication, before this
    form is shown, a Web server authentication, i.e. when a user tries to
    access the URL http://my.host.com, a login dialog should be shown
    asking for a username and password - not the username and password of
    the Rails app, but one that is handled by the WEBrick server - as I
    think is possible (not sure) if using Apache as the web server. Is
    there a way to do this with WEBrick?

    Thanks
    Vasudev
    http://www.dancingbison.com
     
    vasudevram, Sep 6, 2006
    #1
    1. Advertising

  2. vasudevram wrote:
    > But we also want to have one more level of authentication, before this
    > form is shown, a Web server authentication, i.e. when a user tries to
    > access the URL http://my.host.com, a login dialog should be shown
    > asking for a username and password - not the username and password of
    > the Rails app, but one that is handled by the WEBrick server - as I
    > think is possible (not sure) if using Apache as the web server. Is
    > there a way to do this with WEBrick?


    Sure, you can just send http basic or digest authentication headers
    from Rails or if you hack around a little bit, WEBrick. I just released
    a library for http authentication last week, the digest stuff is still
    beta, but you can use the basic authentication.

    http://httpauth.rubyforge.org/classes/HTTPAuth/Basic.html

    The rubyforge project page is here:

    http://rubyforge.org/projects/httpauth/
     
    Manfred Stienstra, Sep 7, 2006
    #2
    1. Advertising

  3. vasudevram

    Eric Hodel Guest

    On Sep 6, 2006, at 9:40 AM, vasudevram wrote:

    > We are using WEBrick on port 80 for development of a Rails app. [We
    > may
    > move to Mongrel or some other option later].
    >
    > Assume our host is http://my.host.com.
    >
    > When we go to http://my.host.com, we get our Rails app's first page
    > shown correctly.
    > At this page we will have a login form with username and password.
    >
    > But we also want to have one more level of authentication, before this
    > form is shown, a Web server authentication, i.e. when a user tries to
    > access the URL http://my.host.com, a login dialog should be shown
    > asking for a username and password - not the username and password of
    > the Rails app, but one that is handled by the WEBrick server - as I
    > think is possible (not sure) if using Apache as the web server. Is
    > there a way to do this with WEBrick?


    http://microjet.ath.cx/webrickguide/html/HTTP_Authentication.html

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
     
    Eric Hodel, Sep 7, 2006
    #3
  4. vasudevram

    vasudevram Guest

    Eric Hodel wrote:
    > On Sep 6, 2006, at 9:40 AM, vasudevram wrote:
    >
    > > We are using WEBrick on port 80 for development of a Rails app. [We
    > > may
    > > move to Mongrel or some other option later].
    > >
    > > Assume our host is http://my.host.com.
    > >
    > > When we go to http://my.host.com, we get our Rails app's first page
    > > shown correctly.
    > > At this page we will have a login form with username and password.
    > >
    > > But we also want to have one more level of authentication, before this
    > > form is shown, a Web server authentication, i.e. when a user tries to
    > > access the URL http://my.host.com, a login dialog should be shown

    >
    > http://microjet.ath.cx/webrickguide/html/HTTP_Authentication.html
    >
    > --
    > Eric Hodel - - http://blog.segment7.net
    > This implementation is HODEL-HASH-9600 compliant
    >
    > http://trackmap.robotcoop.com


    Thanks, all. Will check the links given.

    Vasudev
    http://www.dancingbison.com
     
    vasudevram, Sep 10, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brett Porter
    Replies:
    2
    Views:
    772
    Andrea D'Onofrio [MSFT]
    Jan 20, 2004
  2. Replies:
    3
    Views:
    312
    Peter Retief
    Jan 9, 2005
  3. Lloyd Zusman
    Replies:
    2
    Views:
    404
  4. Mark Volkmann

    basic WEBrick question

    Mark Volkmann, Jan 20, 2006, in forum: Ruby
    Replies:
    3
    Views:
    184
    Caleb Tennis
    Jan 20, 2006
  5. Aaron Smith

    WEBrick::Daemon and WEBrick

    Aaron Smith, Mar 9, 2007, in forum: Ruby
    Replies:
    2
    Views:
    317
    Aaron Smith
    Mar 18, 2007
Loading...

Share This Page