Authenticate based on username and token which is base64-encoded

def auth_string(self):
        '''
        Authenticate based on username and token which is base64-encoded
        '''

        username_token = '{username}:{token}'.format(username=self.username, token=self.token)
        b64encoded_string = b64encode(username_token)
        auth_string = 'Token {b64}'.format(b64=b64encoded_string)

        return auth_string