NAME
Oak::AAS::Session - Authentication and Authorization Service Session
HIERARCHY
DESCRIPTION
This class implements the Client side for the Oak Authentication and Authorization Service.
PROPERTIES
- service
-
The service to be consulted. composed by:
"aas_service;params"
Where:
aas_service => One of the AAS services See L<Oak::AAS::Service|Oak::AAS::Service> for information about services. params => Parameters to the aas service
The AAS Service is instanciated only once, after that a cache copy will be used.
- user
-
The user login
- session_id
-
The unique id of this session
METHODS
- start(user => $login, password => $passwd);
-
Check user and password and start a new session. The session id will be defined in the session_id property. Throws an Oak::AAS::AuthenticationError if the password is invalid
- validate(user => $login, session_id => $sid);
-
Check if this is a valid session. Throws an Oak::AAS::AuthenticationError if not.
- restricted $sessionobj "/path/to/a/service", sub { "do_something" }
-
Test if the current user is allowed to access the specified service. If so, the block will be executed. Else an Oak::AAS::AuthorizationError will be thrown.
The syntax is:
restricted $session "/service", sub { # do something; print "Hello World!"; }; # DO NOT FORGET THE ;
COPYRIGHT
Copyright (c) 2003 Oktiva <http://www.oktiva.com.br> All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.