Add Client-side OAuth2 to HTTP connections

Implement client-side OAuth in non-local HTTP connections.  Also add tests to
verify that the different modes of connection are set up correctly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147636222
This commit is contained in:
mmuller 2017-02-15 13:22:54 -08:00 committed by Ben McIlwain
parent 32b236e940
commit 177bf4a5f1
9 changed files with 303 additions and 6 deletions

View file

@ -0,0 +1,18 @@
# Adding Client Secrets
To use the nomulus tool to administer a nomulus instance, you will need to
obtain OAuth client ids for each of your environment. There's no reason you
can't use the same client id for all of your environments.
To obtain a client id, go to your project's ["credentials"
page](https://console.developers.google.com/apis/credentials) in the Developer's
Console. Click "Create credentials" and select "OAuth client Id" from the
dropdown. In the create credentials window, select an application type of
"Other."
When you return to the main credentials page, click the download icon to the
right of the client id that you just created. This will download a json file
that you should copy to this directory for all of the environments that you
want to use. Don't copy over the "UNITTEST" secret, otherwise your unit tests
will break.

View file

@ -0,0 +1,11 @@
{
"installed": {
"client_id":"SEE-README.md-IN_THIS_DIRECTORY.apps.googleusercontent.com",
"project_id":"your-registry-server",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"YOUR-CLIENT-SECRET",
"redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]
}
}

View file

@ -0,0 +1,11 @@
{
"installed": {
"client_id":"UNITTEST-CLIENT-ID",
"project_id":"DO NOT CHANGE",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"TBj4EcP5c0609ojiy2DIG6wE",
"redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]
}
}