#NEWLINE# def get_authorization_data( self , request ) : #NEWLINE# #INDENT# '\n        Verifies that the HTTP Authorization header has the right auth type\n        (matches self.auth_type) and returns the auth data.\n\n        Raises ValueError when data could not be extracted.\n        ' #NEWLINE# authorization = request . META . get ( 'HTTP_AUTHORIZATION' , '' ) #NEWLINE# if ( not authorization ) : #NEWLINE# #INDENT# raise ValueError ( 'Authorization header missing or empty.' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( auth_type , data ) = authorization . split ( ' ' , 1 ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# raise ValueError ( 'Authorization header must have a space separating auth_type and data.' ) #NEWLINE# #UNINDENT# if ( auth_type . lower ( ) != self . auth_type ) : #NEWLINE# #INDENT# raise ValueError ( ( 'auth_type is not "%s".' % self . auth_type ) ) #NEWLINE# #UNINDENT# return data