Changeset 10408


Ignore:
Timestamp:
5 Jul 2013, 10:48:59 (11 years ago)
Author:
uli
Message:

Set single-sign-on flag correctly on login.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.cas/trunk/waeup/cas/server.py

    r10405 r10408  
    4949
    5050
    51 def create_service_ticket(user, service=None):
     51def create_service_ticket(user, service=None, sso=True):
    5252    """Get a service ticket.
    5353
     
    5555    """
    5656    t_id = 'ST-' + get_random_string(29)
    57     return ServiceTicket(t_id, user, service)
     57    return ServiceTicket(t_id, user, service, sso)
    5858
    5959
     
    133133
    134134
    135 def login_redirect_service(db, service):
     135def login_redirect_service(db, service, sso=True):
    136136    """Return a response redirecting to a service via HTTP 303 See Other.
    137137    """
    138138    # safely redirect to service given
    139     st = create_service_ticket(service)
     139    st = create_service_ticket(service, sso)
    140140    db.add(st)
    141141    service = '%s?ticket=%s' % (service, st.ticket)
     
    214214        if tgc:
    215215            if service:
    216                 return login_redirect_service(self.db, service)
     216                return login_redirect_service(self.db, service, sso=True)
    217217            else:
    218218                return login_success_no_service(
     
    228228                else:
    229229                    # safely redirect to service given
    230                     return login_redirect_service(self.db, service)
     230                    return login_redirect_service(self.db, service, sso=False)
    231231            else:
    232232                # login failed
Note: See TracChangeset for help on using the changeset viewer.