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
| Adc |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/adc.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/adc.js,samples/README.md)|
1190
+
| Authenticate Explicit |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/authenticateExplicit.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/authenticateExplicit.js,samples/README.md)|
1191
+
| Authenticate Implicit With Adc |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/authenticateImplicitWithAdc.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/authenticateImplicitWithAdc.js,samples/README.md)|
1190
1192
| Compute |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/compute.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/compute.js,samples/README.md)|
1191
1193
| Credentials |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/credentials.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/credentials.js,samples/README.md)|
1192
1194
| Downscopedclient |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/downscopedclient.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/downscopedclient.js,samples/README.md)|
1193
1195
| Headers |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/headers.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/headers.js,samples/README.md)|
1196
+
| Id Token From Impersonated Credentials |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idTokenFromImpersonatedCredentials.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idTokenFromImpersonatedCredentials.js,samples/README.md)|
1197
+
| Id Token From Metadata Server |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idTokenFromMetadataServer.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idTokenFromMetadataServer.js,samples/README.md)|
1198
+
| Id Token From Service Account |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idTokenFromServiceAccount.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idTokenFromServiceAccount.js,samples/README.md)|
1194
1199
| ID Tokens for Identity-Aware Proxy (IAP) |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idtokens-iap.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idtokens-iap.js,samples/README.md)|
1195
1200
| ID Tokens for Serverless |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idtokens-serverless.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idtokens-serverless.js,samples/README.md)|
1196
1201
| Jwt |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/jwt.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/jwt.js,samples/README.md)|
@@ -1199,6 +1204,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-auth-librar
1199
1204
| Oauth2-code Verifier |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/oauth2-codeVerifier.js,samples/README.md)|
1200
1205
| Oauth2 |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/oauth2.js,samples/README.md)|
1201
1206
| Sign Blob |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/signBlob.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/signBlob.js,samples/README.md)|
1207
+
| Verify Google Id Token |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/verifyGoogleIdToken.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/verifyGoogleIdToken.js,samples/README.md)|
1202
1208
| Verifying ID Tokens from Identity-Aware Proxy (IAP) |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/verifyIdToken-iap.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/verifyIdToken-iap.js,samples/README.md)|
1203
1209
| Verify Id Token |[source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/verifyIdToken.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/verifyIdToken.js,samples/README.md)|
Copy file name to clipboardExpand all lines: samples/README.md
+108Lines changed: 108 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,15 @@ This is Google's officially supported [node.js](http://nodejs.org/) client libra
13
13
*[Before you begin](#before-you-begin)
14
14
*[Samples](#samples)
15
15
*[Adc](#adc)
16
+
*[Authenticate Explicit](#authenticate-explicit)
17
+
*[Authenticate Implicit With Adc](#authenticate-implicit-with-adc)
16
18
*[Compute](#compute)
17
19
*[Credentials](#credentials)
18
20
*[Downscopedclient](#downscopedclient)
19
21
*[Headers](#headers)
22
+
*[Id Token From Impersonated Credentials](#id-token-from-impersonated-credentials)
23
+
*[Id Token From Metadata Server](#id-token-from-metadata-server)
24
+
*[Id Token From Service Account](#id-token-from-service-account)
20
25
*[ID Tokens for Identity-Aware Proxy (IAP)](#id-tokens-for-identity-aware-proxy-iap)
21
26
*[ID Tokens for Serverless](#id-tokens-for-serverless)
22
27
*[Jwt](#jwt)
@@ -25,6 +30,7 @@ This is Google's officially supported [node.js](http://nodejs.org/) client libra
25
30
*[Oauth2-code Verifier](#oauth2-code-verifier)
26
31
*[Oauth2](#oauth2)
27
32
*[Sign Blob](#sign-blob)
33
+
*[Verify Google Id Token](#verify-google-id-token)
28
34
*[Verifying ID Tokens from Identity-Aware Proxy (IAP)](#verifying-id-tokens-from-identity-aware-proxy-iap)
29
35
*[Verify Id Token](#verify-id-token)
30
36
@@ -60,6 +66,40 @@ __Usage:__
60
66
61
67
62
68
69
+
### Authenticate Explicit
70
+
71
+
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/authenticateExplicit.js).
72
+
73
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/authenticateExplicit.js,samples/README.md)
74
+
75
+
__Usage:__
76
+
77
+
78
+
`node samples/authenticateExplicit.js`
79
+
80
+
81
+
-----
82
+
83
+
84
+
85
+
86
+
### Authenticate Implicit With Adc
87
+
88
+
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/authenticateImplicitWithAdc.js).
89
+
90
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/authenticateImplicitWithAdc.js,samples/README.md)
91
+
92
+
__Usage:__
93
+
94
+
95
+
`node samples/authenticateImplicitWithAdc.js`
96
+
97
+
98
+
-----
99
+
100
+
101
+
102
+
63
103
### Compute
64
104
65
105
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/compute.js).
@@ -128,6 +168,57 @@ __Usage:__
128
168
129
169
130
170
171
+
### Id Token From Impersonated Credentials
172
+
173
+
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idTokenFromImpersonatedCredentials.js).
174
+
175
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idTokenFromImpersonatedCredentials.js,samples/README.md)
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idTokenFromMetadataServer.js).
191
+
192
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idTokenFromMetadataServer.js,samples/README.md)
193
+
194
+
__Usage:__
195
+
196
+
197
+
`node samples/idTokenFromMetadataServer.js`
198
+
199
+
200
+
-----
201
+
202
+
203
+
204
+
205
+
### Id Token From Service Account
206
+
207
+
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/idTokenFromServiceAccount.js).
208
+
209
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/idTokenFromServiceAccount.js,samples/README.md)
210
+
211
+
__Usage:__
212
+
213
+
214
+
`node samples/idTokenFromServiceAccount.js`
215
+
216
+
217
+
-----
218
+
219
+
220
+
221
+
131
222
### ID Tokens for Identity-Aware Proxy (IAP)
132
223
133
224
Requests an IAP-protected resource with an ID Token.
@@ -268,6 +359,23 @@ __Usage:__
268
359
269
360
270
361
362
+
### Verify Google Id Token
363
+
364
+
View the [source code](https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/verifyGoogleIdToken.js).
365
+
366
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-auth-library-nodejs&page=editor&open_in_editor=samples/verifyGoogleIdToken.js,samples/README.md)
367
+
368
+
__Usage:__
369
+
370
+
371
+
`node samples/verifyGoogleIdToken.js`
372
+
373
+
374
+
-----
375
+
376
+
377
+
378
+
271
379
### Verifying ID Tokens from Identity-Aware Proxy (IAP)
272
380
273
381
Verifying the signed token from the header of an IAP-protected resource.
0 commit comments