Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token request failed for Schoology #323

Open
croxis opened this issue Aug 1, 2018 · 0 comments
Open

Token request failed for Schoology #323

croxis opened this issue Aug 1, 2018 · 0 comments

Comments

@croxis
Copy link

croxis commented Aug 1, 2018

I'm using this library via the flask-dance package to add Schoology as a sign in option for my site. For some reason schoology expects GET instead of POST for the request token. Modifying this line to r = self.get(url...) gets it working.

Would the following work as a pull request?

    def _fetch_token(self, url, **request_kwargs):
        log.debug('Fetching token from %s using client %s', url, self._client.client)
        r = self.post(url, **request_kwargs)

        if r.status_code >= 400:
            log.debug('Attempting getting the token instead.')
            r = self.get(url, **request_kwargs)
            if r.status_code >= 400:
                error = "Token request failed with code %s, response was '%s'."
                raise TokenRequestDenied(error % (r.status_code, r.text), r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant