Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.auth.cas.PyCAS Class Reference

List of all members.

Public Member Functions

def __init__
def login_url
def logout_url
def validate_url
def validate_ticket

Public Attributes

 server_url
 renew
 login_path
 logout_path
 validate_path
 coding

Detailed Description

A class for working with a CAS server.

Definition at line 22 of file cas.py.


Constructor & Destructor Documentation

def MoinMoin.auth.cas.PyCAS.__init__ (   self,
  server_url,
  renew = False,
  login_path = '/login',
  logout_path = '/logout',
  validate_path = '/validate',
  coding = 'utf-8' 
)

Definition at line 26 of file cas.py.

00026 
00027                  validate_path='/validate', coding='utf-8'):
00028         self.server_url = server_url
00029         self.renew = renew
00030         self.login_path = login_path
00031         self.logout_path = logout_path
00032         self.validate_path = validate_path
00033         self.coding = coding


Member Function Documentation

def MoinMoin.auth.cas.PyCAS.login_url (   self,
  service 
)
Return the login URL for the given service.

Definition at line 34 of file cas.py.

00034 
00035     def login_url(self, service):
00036         """Return the login URL for the given service."""
00037         url = self.server_url + self.login_path + '?service=' + urllib.quote_plus(service)
00038         if self.renew:
00039             url += "&renew=true"
00040         return url

def MoinMoin.auth.cas.PyCAS.logout_url (   self,
  redirect_url = None 
)
Return the logout URL.

Definition at line 41 of file cas.py.

00041 
00042     def logout_url(self, redirect_url=None):
00043         """Return the logout URL."""
00044         url = self.server_url + self.logout_path
00045         if redirect_url:
00046             url += '?url=' + urllib.quote_plus(redirect_url)
00047         return url

def MoinMoin.auth.cas.PyCAS.validate_ticket (   self,
  service,
  ticket 
)
Validate the given ticket against the given service.

Definition at line 55 of file cas.py.

00055 
00056     def validate_ticket(self, service, ticket):
00057         """Validate the given ticket against the given service."""
00058         f = urllib2.urlopen(self.validate_url(service, ticket))
00059         valid = f.readline()
00060         valid = valid.strip() == 'yes'
00061         user = f.readline().strip()
00062         user = user.decode(self.coding)
00063         return valid, user
00064 

Here is the call graph for this function:

def MoinMoin.auth.cas.PyCAS.validate_url (   self,
  service,
  ticket 
)
Return the validation URL for the given service. (For CAS 1.0)

Definition at line 48 of file cas.py.

00048 
00049     def validate_url(self, service, ticket):
00050         """Return the validation URL for the given service. (For CAS 1.0)"""
00051         url = self.server_url + self.validate_path + '?service=' + urllib.quote_plus(service) + '&ticket=' + urllib.quote_plus(ticket)
00052         if self.renew:
00053             url += "&renew=true"
00054         return url

Here is the caller graph for this function:


Member Data Documentation

Definition at line 32 of file cas.py.

Definition at line 29 of file cas.py.

Definition at line 30 of file cas.py.

Definition at line 28 of file cas.py.

Definition at line 27 of file cas.py.

Definition at line 31 of file cas.py.


The documentation for this class was generated from the following file: