aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/caldav
diff options
context:
space:
mode:
authorDino Macri <36100525+dinomacri@users.noreply.github.com>2018-07-20 19:27:51 +0930
committerLukas Fleischer <lfleischer@calcurse.org>2018-07-22 11:00:12 +0200
commit6a6c7117dee91c9fd11c2b30f34f70386f1fba21 (patch)
treecafb74f59a59c030f179a44eddca1ef6b5bab3c3 /contrib/caldav
parent61dc7ab53843567636eaac3874eff299ec8c10bd (diff)
downloadcalcurse-6a6c7117dee91c9fd11c2b30f34f70386f1fba21.tar.gz
calcurse-6a6c7117dee91c9fd11c2b30f34f70386f1fba21.zip
calcurse-caldav: fix basic authentication
Read whether basic authentication is used and add the credentials to httplib2 when making a request. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib/caldav')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index 39409d6..2c5757e 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -656,6 +656,11 @@ try:
# Authenticate with OAuth2 and authorize HTTP object
cred = run_auth(authcode)
conn = cred.authorize(conn)
+
+ # Add credentials to httplib2 to be used when request requires authentication
+ if authmethod == 'basic':
+ conn.add_credentials(username, password)
+
elif authmethod != 'basic':
die('Invalid option for AuthMethod in config file. Use "basic" or "oauth2"')