Last Modified
2012-07-30 17:04:42 +0000
Requires

Description

A credential store for HTTP authentication.

  uri = URI 'http://example'

  store = Mechanize::HTTP::AuthStore.new
  store.add_auth uri, 'user1', 'pass'
  store.add_auth uri, 'user2', 'pass', 'realm'

  user, pass = store.credentials_for uri, 'realm' #=> 'user2', 'pass'
  user, pass = store.credentials_for uri, 'other' #=> 'user1', 'pass'

  store.remove_auth uri # removes all credentials