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

Update XOAUTH2 support to work with Google's newer .json files #68

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@Secretions

Secretions commented May 27, 2016

When creating a service account, Google has switched to providing
a .json file with the private key, oauth client id, and other data
instead of an encrypted .p12 file with the just the private key.

This adds support to read one of these .json files instead of the
.p12 format. .p12 files are still supported, and which format is
read is determined by the formatting of the argument.

This is more convenient, but also avoids confusion around the
oauth client ids. Previously, the client id matches the service
account name Google generated. Now they are different, but this
fact isn't terribly apparent from their management interface.

Also avoids calling openssl.

Also added support for spaces in the filename for the .p12 files.

So now you would just use this:

--password1 'Gmail Migration-02305af9c080.json'

Instead of this:

--password1 '12345-some-googleapsid.apps.googleusercontent.com;somekeyfile.p12'

Joaquin Lopez and others added some commits Feb 17, 2015

Joaquin Lopez
Adds XOAUTH2 support, intended for Gmail.
Makes --authmechX accept "XOAUTH2", which then uses the password for parameters.

--passwordX needs to be in the following format:
"<service account>;<keyfile location>;<keyfile password>"

<service account> is the name of the Google Developer API service account.

<keyfile location> is the location of the keyfile associated with it.

<keyfile password> is the password to access the keyfile. Entering this
password is optional--it will assume "notasecret" if not provided, which
is the default password Google uses with the keyfiles.

Example arguments for using XOAUTH might look like this:

--authmech1 xoauth2 --password1 '123456789012-abcd0abcde0ab1abc2345ab6abcdefgh@developer.gserviceaccount.com;some_keyfile.p12'

This assumes "some_keyfile" is in the current directory, and uses the default
"notasecret" password.
XOAUTH2 support for Google JSON Data
When creating a service account, Google has switched to providing
a .json file with the private key, oauth client id, and other data
instead of an encrypted .p12 file with the just the private key.

This adds support to read one of these .json files instead of the
.p12 format. .p12 files are still supported, and which format is
read is determined by the formatting of the argument.

This is more convenient, but also avoids confusion around the
oauth client ids. Previously, the client id matches the service
account name Google generated. Now they are different, but this
fact isn't terribly apparent from their management interface.

Also added support for spaces in the filename for the .p12 files.
@gilleslamiral

This comment has been minimized.

Show comment
Hide comment
@gilleslamiral

gilleslamiral May 29, 2016

Member

Hi Secretions,

Very good, I'm going to integrate that upstream!

Le 27/05/2016 à 23:44, Secretions a écrit :

When creating a service account, Google has switched to providing
a .json file with the private key, oauth client id, and other data
instead of an encrypted .p12 file with the just the private key.

This adds support to read one of these .json files instead of the
.p12 format. .p12 files are still supported, and which format is
read is determined by the formatting of the argument.

This is more convenient, but also avoids confusion around the
oauth client ids. Previously, the client id matches the service
account name Google generated. Now they are different, but this
fact isn't terribly apparent from their management interface.

Also avoids calling openssl.

Also added support for spaces in the filename for the .p12 files.

So now you would just use this:

--password1 'Gmail Migration-02305af9c080.json'

Instead of this:

--password1 '12345-some-googleapsid.apps.googleusercontent.com;somekeyfile.p12'


    You can view, comment on, or merge this pull request online at:

#68

Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06

Member

gilleslamiral commented May 29, 2016

Hi Secretions,

Very good, I'm going to integrate that upstream!

Le 27/05/2016 à 23:44, Secretions a écrit :

When creating a service account, Google has switched to providing
a .json file with the private key, oauth client id, and other data
instead of an encrypted .p12 file with the just the private key.

This adds support to read one of these .json files instead of the
.p12 format. .p12 files are still supported, and which format is
read is determined by the formatting of the argument.

This is more convenient, but also avoids confusion around the
oauth client ids. Previously, the client id matches the service
account name Google generated. Now they are different, but this
fact isn't terribly apparent from their management interface.

Also avoids calling openssl.

Also added support for spaces in the filename for the .p12 files.

So now you would just use this:

--password1 'Gmail Migration-02305af9c080.json'

Instead of this:

--password1 '12345-some-googleapsid.apps.googleusercontent.com;somekeyfile.p12'


    You can view, comment on, or merge this pull request online at:

#68

Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06

@gilleslamiral

This comment has been minimized.

Show comment
Hide comment
@gilleslamiral

gilleslamiral Jun 8, 2016

Member

Hi Secretions,

Thanks very much!

Patch applied and tested.
Available in next public release, coming soon.

Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06

Member

gilleslamiral commented Jun 8, 2016

Hi Secretions,

Thanks very much!

Patch applied and tested.
Available in next public release, coming soon.

Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment