carddav-util icon indicating copy to clipboard operation
carddav-util copied to clipboard

Problem with CardDAV server of Google

Open Symnok opened this issue 3 years ago • 1 comments
trafficstars

Google has its own CardDAV server that does not require OAUTH2 authentication.

Login: [email protected] (your Gmail email address)

Password: Application specific password (not your Google main password) that can be generated from within security settings of Google Account. You need to enable 2FA first to generate this password.

CardDAV URL: https://www.google.com/carddav/v1/principals/[email protected]/lists/default/
where [email protected] your Gmail email address

This settings can be used for accessing Google contacts on PC using standard Mail and Calendar program, on Android (using DAVx5 app), on iPhone (using built-in CardDAV client) and even on Windows 10 Mobile devices.

In all cases, no OAUTH2 Authentication required.

Unfortunately, carddav-util does not work with this server:

symnok@myserver:~/carddav-util$ python3 ./carddav-util.py --download [email protected] --passwd=abcd1234defg5678 --file=test.vcf --url=https://www.google.com/carddav/v1/principals/[email protected]/lists/default/ Response:

[i] Downloading from https://www.google.com/carddav/v1/principals/[email protected]/lists/default/ to test.vcf ... [i] Downloading the addressbook... [!] Error code: 400 b'{\n "error": {\n "code": 400,\n "message": "Request contains an invalid argument.",\n "status": "INVALID_ARGUMENT"\n }\n}\n'

Login and password are correct because when I use incorrect password I get

[i] Downloading the addressbook... [!] Error code: 401 b'{\n "error": {\n "code": 401,\n "message": "Invalid Credentials",\n "status": "UNAUTHENTICATED"\n }\n}\n'

Symnok avatar Jul 24 '22 22:07 Symnok

I can't help you of the top of my head and don't have the time to investigate at the moment. You seem to have enough skill to figure it out yourself. I'd be happy to accept a pull request.

ljanyst avatar Jul 27 '22 10:07 ljanyst