ARCHBOM-1667: fix: remove authentication from auth exchange (#26618)

* Remove authentication, including SessionAuthentication, to fix CSRF
  exemption by dropping CSRF check of SessionAuthentication.
* Several changes to make it more clear that only POST is supported and
  clean up GET method testing.
* Removed the temporary 403 error logging that wasn't working.
* Removed test_single_access_token which was written for DOP, but
  doesn't work with DOT. See
  [MA-2122](https://openedx.atlassian.net/browse/MA-2122) for a ticket
  about implementing this for DOT, although it doesn't seem to be a
  priority. NOTE: A comment was added to the ticket explaining that this
  test was removed.
* GET now returns default error for methods not allowed.

ARCHBOM-1667
This commit is contained in:
Robert Raposa
2021-02-23 10:57:11 -05:00
committed by GitHub
parent 9fe56d1762
commit 40611bb915
6 changed files with 40 additions and 89 deletions

View File

@@ -36,7 +36,7 @@ class ThirdPartyOAuthTestMixin(ThirdPartyAuthTestMixin):
def setUp(self): # lint-amnesty, pylint: disable=arguments-differ
super(ThirdPartyOAuthTestMixin, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
if self.CREATE_USER:
self.user = UserFactory()
self.user = UserFactory.create(password='secret')
UserSocialAuth.objects.create(user=self.user, provider=self.BACKEND, uid=self.social_uid)
self.oauth_client = self._create_client()
if self.BACKEND == 'google-oauth2':