# Login Prompt - how to?

**URL:** <https://www.ruby-forum.com/t/login-prompt-how-to/184782>\
**Category:** Ruby\
**Created:** [March 8, 2010, 4:28pm UTC](https://www.ruby-forum.com/t/login-prompt-how-to/184782 "2010-03-08T16:28:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e95f7d/32.png) [@brunik](https://www.ruby-forum.com/u/brunik)\
**Post date:** [March 8, 2010, 4:28pm UTC](https://www.ruby-forum.com/t/login-prompt-how-to/184782/1 "2010-03-08T16:28:29Z")

</div>

Hello everyone,

Can anyone tell me how I can login to a web page using a login prompt?  
[http://oit.pdx.edu/files/myfiles1.png](http://oit.pdx.edu/files/myfiles1.png)

or please point me to a gem or what to study in order to be able to do  
this.

I have used Watir until now for normal login pages, but it doesn’t seem  
to be able to handle prompts.

---

<div class="post-metadata">

**Author:** ![brunik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e95f7d/32.png) [@brunik](https://www.ruby-forum.com/u/brunik)\
**Post date:** [March 8, 2010, 5:08pm UTC](https://www.ruby-forum.com/t/login-prompt-how-to/184782/2 "2010-03-08T17:08:30Z")

</div>

That looks like standard HTTP authentication (Basic/Digest).

You will need a regular HTTP client library in order to supply  
credentials,  
like Httparty, HttpClient, Mechanize etc.

You might have better luck with Celerity ( a JRuby implementation of  
Watir,  
that uses a pure java Http Client, instead of automating a browser) -  
the  
API  
might expose methods for dealing with HTTP auth instead of form  
authentication.

There are a LOT of Ruby HTTP libraries out there - you might have to do  
a  
bit of homework  
on them and their feature sets.

Also double check the Watir site. Popups of all kinds are a real  
annoyance  
there, and they  
have developed a couple of interesting workarounds. They might also  
recommend alternatives  
that I haven’t mentioned here.
