def parseAuthorization(credentials):
 global AUTH_SCHEMES
 (auth_scheme, auth_params) = credentials.split(' ', 1)
 auth_scheme = auth_scheme.lower()
 parser = AUTH_SCHEMES[auth_scheme]
 params = parser(auth_params)
 if (params is None):
  return
 assert ('auth_scheme' not in params)
 params['auth_scheme'] = auth_scheme
 return params

def parseAuthorization ( credentials ) : global AUTH_SCHEMES ( auth_scheme , auth_params ) = credentials . split ( ' ' , 1 ) auth_scheme = auth_scheme . lower ( ) parser = AUTH_SCHEMES [ auth_scheme ] params = parser ( auth_params ) if ( params is None ) : return assert ( 'auth_scheme' not in params ) params [ 'auth_scheme' ] = auth_scheme return params
parseauthorization will convert the value of the authorization key in the http header to a map itself .