Skip to content

CSRF token not available anymore. #37

@MSusik

Description

@MSusik

In the past the way to obtain the CSRF token was:

    def _authenticate(self, user_id, password, redirect_uri, scope):

        session = requests.session()
        session.get('https://' + self._host + '/signout',
                    timeout=self._timeout)
        params = {
            'client_id': self._key,
            'response_type': 'code',
            'scope': scope,
            'redirect_uri': redirect_uri
        }

        response = session.get(self._login_or_register_endpoint,
                               params=params,
                               headers={'Host': self._host},
                               timeout=self._timeout)

        response.raise_for_status()

        soup = BeautifulSoup(response.content, 'html5lib')
        csrf = soup.find(attrs={'name': '_csrf'}).attrs['content']

Unfortunately, the token is not available there anymore. The subsequent authentication request will fail with 400 if no CSRF token is provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions