Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.
/ open_id_authorization Public archive

Library for OpenID authentication and authorization

License

Notifications You must be signed in to change notification settings

meet/open_id_authorization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenIdAuthorization
===================

A wrapper around open_id_authentication to use OpenID Attribute Exchange for authorization information.

NOTE: Requires that open_id_authentication NOT be installed as a plugin in vendor/plugins!

Instead, this gem will handle the initialization of open_id_authentication in Rails 3 style.
Add the following to your Gemfile:

  gem 'open_id_authentication', '0.0.1', :git => 'git://github.com/rails/open_id_authentication.git'
  gem 'open_id_authorization', '0.0.1', :git => 'git://github.com/meet/open_id_authorization.git'

First specify the OpenID server to use (assumes identity_select):

  OpenIdAuthorization.provider = 'https://openid.server/'

Then, in a controller, do something like:

  authorize_with_open_id(:required => [ :groups ]) do |result, identity_url, attributes|
    if result.successful?
      # username is always retrieved
      attributes[:username] == 'root'
      
      # comma-separated values are split back into an Array
      attributes[:groups].include? 'wheel'
      
    else
      # authentication failed
      
    end
  end

Or pass the server as the first argument.


Authorization
=============

Remarkably, authorize_with_open_id performs no authorization whatsoever; your code must do this.

About

Library for OpenID authentication and authorization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages