Skip to content

Commit 3384ce0

Browse files
committed
added note about not following redirect on the OP GET to authenticate
1 parent a01e7d6 commit 3384ce0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

elmclient/httpops.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,10 @@ def _jsa_login(self, auth_url, ap_redirect_url, url):
779779
# do the login
780780
username, password = self.get_user_password(auth_url)
781781
appassword = self.get_app_password( url )
782+
783+
# if redirects are automatically followed on this call to authenticate with the OP, the GET of the original protected resource fails, and so the authentication fails.
784+
# this may be because this GET doesn't have headers like OSLC-Core-Version.
785+
# Solution is not to follow redirects and ensure that the original GET is repeated, i.e. with the correct headers :-)
782786
auth_url_response = self._session.get( str(ap_redirect_url), auth=(username, appassword), headers={ "User-Agent":"Python2 app-password-enabled" }, allow_redirects=False ) # Load up them cookies!
783787

784788
return None

0 commit comments

Comments
 (0)