code: def get_access_token(self, request):
          
          header = authentication.get_authorization_header(request)
          if not header:
              return None
          header = header.decode(authentication.HTTP_HEADER_ENCODING)
  
          auth = header.split()
  
          if auth[0].lower() != 'bearer':
              return None
  
          if len(auth) == 1:
              msg = 'Invalid "bearer" header: No credentials provided.'
              raise exceptions.AuthenticationFailed(msg)
          elif len(auth) > 2:
              msg = 'Invalid "bearer" header: Credentials string should not contain spaces.'
              raise exceptions.AuthenticationFailed(msg)
  
          return auth[1]
docs: Get the access token based on a request.
  
          Returns None if no authentication details were provided. Raises
          AuthenticationFailed if the token is incorrect.