Parse token and secret from raw token response.

def parse_raw_token(self, raw_token):
        """Parse token and secret from raw token response."""
        if raw_token is None:
            return (None, None, None)
        # Load as json first then parse as query string
        try:
            token_data = json.loads(raw_token)
        except ValueError:
            qs = parse_qs(raw_token)
            token = qs.get('access_token', [None])[0]
            refresh_token = qs.get('refresh_token', [None])[0]
            expires_at = qs.get(self.expires_in_key, [None])[0]
        else:
            token = token_data.get('access_token', None)
            refresh_token = token_data.get('refresh_token', None)
            expires_at = token_data.get(self.expires_in_key, None)

        if expires_at:
            expires_at = timezone.now() + timedelta(seconds=int(expires_at))

        return (token, refresh_token, expires_at)