CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 22 Aug 2025 15:26:07 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090222195353
location: https://web.archive.org/web/20090222195353/https://github.com/rails/http_authentication/tree
server-timing: captures_list;dur=0.542101, exclusion.robots;dur=0.019323, exclusion.robots.policy;dur=0.008710, esindex;dur=0.013724, cdx.remote;dur=28.045271, LoadShardBlock;dur=267.728873, PetaboxLoader3.datanode;dur=91.390807, PetaboxLoader3.resolve;dur=106.145246
x-app-server: wwwb-app210
x-ts: 302
x-tr: 319
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app210; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Fri, 22 Aug 2025 15:26:07 GMT
content-type: text/html; charset=utf-8
content-length: 121
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 22 Feb 2009 19:53:52 GMT
x-archive-orig-connection: close
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090222195353/https://github.com/rails/http_authentication/tree/master
x-archive-orig-x-runtime: 86ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 121
cache-control: max-age=1800
memento-datetime: Sun, 22 Feb 2009 19:53:53 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 11 Oct 2008 09:06:30 GMT", ; rel="prev memento"; datetime="Thu, 18 Dec 2008 01:30:48 GMT", ; rel="memento"; datetime="Sun, 22 Feb 2009 19:53:53 GMT", ; rel="next memento"; datetime="Fri, 18 Sep 2009 23:00:15 GMT", ; rel="last memento"; datetime="Fri, 18 Sep 2009 23:00:15 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_8_20090222181749_crawl102-c/52_8_20090222195239_crawl101.arc.gz
server-timing: captures_list;dur=0.483297, exclusion.robots;dur=0.017995, exclusion.robots.policy;dur=0.008814, esindex;dur=0.010109, cdx.remote;dur=4.557224, LoadShardBlock;dur=257.660152, PetaboxLoader3.datanode;dur=194.320332, PetaboxLoader3.resolve;dur=314.205518, load_resource;dur=290.750060
x-app-server: wwwb-app210
x-ts: 301
x-tr: 589
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 22 Aug 2025 15:26:09 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 22 Feb 2009 19:53:53 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 255ms
x-archive-orig-etag: "b36953bac18cf36b7ded2af666a7c341"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 19291
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 22 Feb 2009 19:53:53 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sun, 14 Sep 2008 16:28:20 GMT", ; rel="prev memento"; datetime="Sun, 01 Feb 2009 06:54:31 GMT", ; rel="memento"; datetime="Sun, 22 Feb 2009 19:53:53 GMT", ; rel="next memento"; datetime="Thu, 05 Mar 2009 12:16:40 GMT", ; rel="last memento"; datetime="Tue, 14 Apr 2009 23:10:41 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_8_20090222181749_crawl102-c/52_8_20090222195239_crawl101.arc.gz
server-timing: captures_list;dur=0.753371, exclusion.robots;dur=0.029257, exclusion.robots.policy;dur=0.011945, esindex;dur=0.016790, cdx.remote;dur=127.342548, LoadShardBlock;dur=546.644565, PetaboxLoader3.datanode;dur=496.604094, PetaboxLoader3.resolve;dur=696.456932, load_resource;dur=700.238459
x-app-server: wwwb-app210
x-ts: 200
x-tr: 1454
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
rails's http_authentication at master - GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | Http Authentication |
Homepage: | https://rubyonrails.org |
Clone URL: |
git://github.com/rails/http_authentication.git
Give this clone URL to anyone.
git clone git://github.com/rails/http_authentication.git
|
name | age | message | |
---|---|---|---|
![]() |
README | Sat Dec 02 17:05:49 -0800 2006 | Make it invitingly easy for someone to implemen... [dhh] |
![]() |
Rakefile | Sat Dec 02 16:25:22 -0800 2006 | Added HTTP authentication plugin [DHH] [dhh] |
![]() |
init.rb | Sat Dec 02 16:25:22 -0800 2006 | Added HTTP authentication plugin [DHH] [dhh] |
![]() |
lib/ | Sat Dec 02 17:05:49 -0800 2006 | Make it invitingly easy for someone to implemen... [dhh] |
![]() |
test/ | Sat Dec 02 17:05:49 -0800 2006 | Make it invitingly easy for someone to implemen... [dhh] |
Http Authentication =================== Makes it dead easy to do HTTP Basic authentication. Simple Basic example: class PostsController < ApplicationController USER_NAME, PASSWORD = "dhh", "secret" before_filter :authenticate, :except => [ :index ] def index render :text => "Everyone can see me!" end def edit render :text => "I'm only accessible if you know the password" end private def authenticate authenticate_or_request_with_http_basic do |user_name, password| user_name == USER_NAME && password == PASSWORD end end end Here is a more advanced Basic example where only Atom feeds and the XML API is protected by HTTP authentication, the regular HTML interface is protected by a session approach (NOTE: This example requires Rails Edge as it uses Request#format, which is not available in Rails 1.2.0): class ApplicationController < ActionController::Base before_filter :set_account, :authenticate protected def set_account @account = Account.find_by_url_name(request.subdomains.first) end def authenticate case request.format when Mime::XML, Mime::ATOM if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) } @current_user = user else request_http_basic_authentication end else if session_authenticated? @current_user = @account.users.find(session[:authenticated][:user_id]) else redirect_to(login_url) and return false end end end end In your integration tests, you can do something like this: def test_access_granted_from_xml get( "/notes/1.xml", nil, :authorization => HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) ) assert_equal 200, status end Todo: * Implement Digest authentication scheme (be a hero, implement it!) References: * HTTP Authentication, RFC 2617: https://www.ietf.org/rfc/rfc2617.txt?number=2617 Copyright (c) 2006 David Heinemeier Hansson, released under the MIT license
This feature is coming soon. Sit tight!