File: auth_store.rb [mechanize-2.7.3 Documentation]

Last Modified
  2015-08-17 12:05:55 +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