Re: Authorization handler

"Michal Koudelka" <[email protected]> Thu, 18 Aug 2005 10:23:20 +0200
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Thank :) Looks nice :)

______________________________________________________________
> Od: [email protected]
> Komu: ML)
> CC: 
> Datum: 18.08.2005 06:43
> Předmět: Re: Authorization handler
>
> A simple class to handle Access, Authentication, and Authorization
> would be something like this
> 
> #myauth.rb
> require 'singleton'
> class MyAuth
> include Singleton
> 
> #function called via RubyAccessHandler
> def check_access(req)
> return Apache::OK
> end
> 
> #function called via RubyAuthenHandler
> def authenticate(req)
> return Apache::OK
> end
> 
> #function called via RubyAuthzHandler
> def authorize(req)
> return Apache::OK
> end
> end
> 
> Each one of those functions takes the Apache::Request object as a
> parameter and then returns an Apache error code when finished usally
> either OK for success or FORBIDDEN if the user isn't allowed access
> 
> Once you have your class written you should be able to install the
> handlers in Apache by adding these lines into your httpd.conf file
> 
> RubyRequire myauth
> RubyAccessHandler MyAuth.instance
> RubyAuthenHandler MyAuth.instance
> RubyAuthzHandler MyAuth.instance
> AuthType 
> AuthName 
> 
> 
> Brian Johnson
> 
> On 8/16/05, Michal Koudelka  wrote:
> > Hi,
> > 
> > Can anybody give me short example how to create authenhandler in
> mod_ruby? I found nothing in modruby wiki
> > 
> > Thank you
> > 
> > 
> >
> 
>