You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix various issuers in appengine/flexible/endpoints/README.md (#495)
* Use three back-ticks to indicate code block (It seems indentation-based code block doesn't work if it's right after a list)
* Fix IAM link
* Avoid surrounding project id placeholders with angle brackets
Copy file name to clipboardExpand all lines: appengine/flexible/endpoints/README.md
+45-32Lines changed: 45 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -14,22 +14,25 @@ This sample consists of two parts:
14
14
For more info on running Flexible applications locally, see [the getting started documentation](https://cloud.google.com/python/getting-started/hello-world).
15
15
16
16
Install all the dependencies:
17
-
18
-
$ virtualenv env
19
-
$ source env/bin/activate
20
-
$ pip install -r requirements.txt
17
+
```bash
18
+
$ virtualenv env
19
+
$ source env/bin/activate
20
+
$ pip install -r requirements.txt
21
+
```
21
22
22
23
Run the application:
23
-
24
-
$ python main.py
24
+
```bash
25
+
$ python main.py
26
+
```
25
27
26
28
In your web browser, go to the following address: http://localhost:8080.
27
29
28
30
### Using the echo client
29
31
30
32
With the app running locally, you can execute the simple echo client using:
### Using the App Engine default service account client (no key file needed)
98
105
@@ -104,11 +111,12 @@ To use the App Engine default service account for authentication:
104
111
1. Update the `gae_default_service_account`'s `x-issuer` and `x-jwks_uri` in `swagger.yaml` with your client project ID.
105
112
2. Redeploy your server application.
106
113
3. Update clients/service_to_service_gae_default/main.py, replace 'YOUR-CLIENT-PROJECT-ID' and 'YOUR-SERVER-PROJECT-ID' with your client project ID and your server project ID.
107
-
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
114
+
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
Your client app is now deployed at https://<YOUR-CLIENT-PROJECT-ID>.appspot.com. When you access https://<YOUR-CLIENT-PROJECT-ID>.appspot.com, your client calls your server project API using
119
+
Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API using
112
120
the client's service account.
113
121
114
122
### Using the service account client (no key file needed)
@@ -120,7 +128,8 @@ The client project is running Google App Engine standard application.
120
128
In the example, we use Google Cloud Identity and Access Management (IAM) API to create a JSON Web Token (JWT) for a service account, and use it to call an Endpoints API.
121
129
122
130
To use the client, you will need to enable "Service Account Actor" role for App Engine default service account:
123
-
1. Go to [IAM page] of your client project (https://console.cloud.google.com/iam-admin/iam).
131
+
132
+
1. Go to [IAM page](https://console.cloud.google.com/iam-admin/iam) of your client project.
124
133
2. For App Engine default service account, from “Role(s)” drop-down menu, select “Project”-“Service Account Actor”, and Save.
125
134
126
135
You also need to install Google API python library because the client code (main.py) uses googleapiclient,
@@ -129,15 +138,17 @@ Google API python client library should have already been installed under 'lib'
1. Update the `google_service_account`'s `x-issuer` and `x-jwks_uri` in `swagger.yaml` with your service account email.
133
143
2. Redeploy your server application.
134
-
3. Update clients/service_to_service_non_default/main.py, replace 'YOUR-SERVICE-ACCOUNT-EMAIL', 'YOUR-SERVER-PROJECT-ID' and 'YOUR-CLIENT-PROJECT-ID'
135
-
with your service account email, your server project ID, and your client project ID.
136
-
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
Your client app is now deployed at https://<YOUR-CLIENT-PROJECT-ID>.appspot.com. When you access https://<YOUR-CLIENT-PROJECT-ID>.appspot.com, your client calls your server project API using
144
+
3. Update clients/service_to_service_non_default/main.py by replacing 'YOUR-SERVICE-ACCOUNT-EMAIL', 'YOUR-SERVER-PROJECT-ID' and 'YOUR-CLIENT-PROJECT-ID'
145
+
with your service account email, your server project ID, and your client project ID, respectively.
146
+
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API using
141
152
the client's service account.
142
153
143
154
### Using the ID token client (no key file needed)
@@ -150,12 +161,14 @@ We refer to the project that serves API requests as the server project. You also
150
161
The client project is running Google App Engine standard application.
151
162
152
163
To use the client for authentication:
164
+
153
165
1. Update the `google_id_token`'s audiences, replace `YOUR-SERVER-PROJECT-ID` with your server project ID.
154
166
2. Redeploy your server application.
155
167
3. Update clients/service_to_service_google_id_token/main.py, replace 'YOUR-CLIENT-PROJECT-ID' and 'YOUR-SERVER-PROJECT-ID' with your client project ID and your server project ID.
156
-
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
Your client app is now deployed at https://<YOUR-CLIENT-PROJECT-ID>.appspot.com. When you access https://<YOUR-CLIENT-PROJECT-ID>.appspot.com, your client calls your server project API from
173
+
Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API from
161
174
the client's service account using Google ID token.
0 commit comments