Class: Rack::OpenID::SimpleAuth

### Home Classes Methods

### In Files

- lib/rack/openid/simple_auth.rb

### Parent

Object

### Methods

- ::new
- ::new
- #call

### Class/Module Index

Quicksearch

- Rack
- Rack::OpenID
- Rack::OpenID::MissingResponse
- Rack::OpenID::SimpleAuth
- Rack::OpenID::TimeoutResponse

No matching classes.

# Rack::OpenID::SimpleAuth

A simple OpenID middleware that restricts access to a single identifier.

    use Rack::OpenID::SimpleAuth, "http://example.org"

SimpleAuth will automatically insert the required Rack::OpenID middleware, so use Rack::OpenID is unnecessary.

### Attributes

app[R]
identifier[R]

### Public Class Methods

new(*args) click to toggle source

    # File lib/rack/openid/simple_auth.rb, line 14
    def self.new(*args)
      Rack::OpenID.new(super)
    end

new(app, identifier) click to toggle source

    # File lib/rack/openid/simple_auth.rb, line 20
    def initialize(app, identifier)
      @app        = app
      @identifier = identifier
    end

### Public Instance Methods

call(env) click to toggle source

    # File lib/rack/openid/simple_auth.rb, line 25
    def call(env)
      if session_authenticated?(env)
        app.call(env)
      elsif successful_response?(env)
        authenticate_session(env)
        redirect_to requested_url(env)
      else
        authentication_request
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.