Changeset 1642 for trunk/packages


Ignore:
Timestamp:
Nov 14, 2008, 3:39:21 AM (16 years ago)
Author:
broder
Message:

Add (crude) support for SPNEGO in the web interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/main.py

    r1634 r1642  
    653653def getUser(environ):
    654654    """Return the current user based on the SSL environment variables"""
    655     return environ.get('REMOTE_USER', None)
     655    user = environ.get('REMOTE_USER')
     656    if user is None:
     657        return
     658   
     659    if environ.get('AUTH_TYPE') == 'Negotiate':
     660        # Convert the krb5 principal into a krb4 username
     661        if not user.endswith('@%s' % config.authn[0].realm):
     662            return
     663        else:
     664            return user.split('@')[0].replace('/', '.')
     665    else:
     666        return user
    656667
    657668def handler(username, state, path, fields):
Note: See TracChangeset for help on using the changeset viewer.