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
Copy file name to clipboardexpand all lines: content/docs/topics/getting-users-identity.md
+66-25
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,19 @@ To secure your app with signed headers, you'll need the following:
14
14
15
15
## Verification
16
16
17
-
If a [signing key] is set, the user's associated identity information will be included in a signed attestation JWT that will be added to each requests's upstream header `X-Pomerium-Jwt-Assertion`. You should verify that the JWT contains at least the following claims:
|`exp`| Expiration time in seconds since the UNIX epoch. Allow 1 minute for skew. |
22
-
|`iat`| Issued-at time in seconds since the UNIX epoch. Allow 1 minute for skew. |
23
-
|`aud`| The client's final domain e.g. `httpbin.corp.example.com`. |
24
-
|`iss`| Issuer must be the URL of your authentication domain e.g. `authenticate.corp.example`. |
25
-
|`sub`| Subject is the user's id. Can be used instead of the `X-Pomerium-Claim-Sub` header. |
26
-
|`email`| Email is the user's email. Can be used instead of the `X-Pomerium-Claim-Email` header. |
27
-
|`groups`| Groups is the user's groups. Can be used instead of the `X-Pomerium-Claim-Groups` header. |
17
+
If a [signing key] is set, the user's associated identity information will be included in a signed attestation JWT that will be added to each requests's upstream header `X-Pomerium-Jwt-Assertion`. The signed attestation JWT is also available at the special `/.pomerium/jwt` endpoint of any URL handled by Pomerium.
18
+
19
+
You should verify that the JWT contains at least the following claims:
|`exp`| Expiration time in seconds since the UNIX epoch. Allow 1 minute for skew. |
24
+
|`iat`| Issued-at time in seconds since the UNIX epoch. Allow 1 minute for skew. |
25
+
|`aud`| The client's final domain e.g. `httpbin.corp.example.com`. |
26
+
|`iss`| Issuer must be the URL of your authentication domain e.g. `authenticate.corp.example`. |
27
+
|`sub`| Subject is the user's id. Can be used instead of the `X-Pomerium-Claim-Sub` header. |
28
+
|`email`| Email is the user's email. Can be used instead of the `X-Pomerium-Claim-Email` header. |
29
+
|`groups`| Groups is the user's groups. Can be used instead of the `X-Pomerium-Claim-Groups` header. |
28
30
29
31
The attestation JWT's signature can be verified using the public key which can be retrieved at Pomerium's `/.well-known/pomerium/jwks.json` endpoint which lives on the authenticate service. A `jwks_uri` is useful when integrating with other systems like [istio](https://istio.io/docs/reference/config/security/istio.authentication.v1alpha1/). For example:
A single-page javascript application can verify the JWT using a fetch to `/.pomerium/jwt` and a JWT library like [`jose`](https://github.com/panva/jose).
Though you will very likely be verifying signed-headers programmatically in your application's middleware, and using a third-party JWT library, if you are new to JWT it may be helpful to show what manual verification looks like.
69
110
70
-
1. Provide pomerium with a base64 encoded Elliptic Curve ([NIST P-256] aka [secp256r1] aka prime256v1) Private Key. In production, you'd likely want to get these from your KMS.
111
+
1. Provide Pomerium with a base64 encoded Elliptic Curve ([NIST P-256] aka [secp256r1] aka prime256v1) Private Key. In production, you'd likely want to get these from your KMS.
1. Reload `pomerium-proxy`. Navigate to httpbin (by default, `https://httpbin.corp.${YOUR-DOMAIN}.com`), and login as usual. Click **request inspection**. Select `/headers`. Click **try it out** and then **execute**. You should see something like the following.
1.`X-Pomerium-Jwt-Assertion` is the signature value. It's less scary than it looks and basically just a compressed, json blob as described above. Navigate to [jwt.io] which provides a helpful GUI to manually verify JWT values.
90
131
91
132
1. Paste the value of `X-Pomerium-Jwt-Assertion` header token into the `Encoded` form. You should notice that the decoded values look much more familiar.
1. Finally, we want to cryptographically verify the validity of the token. To do this, we will need the signer's public key. You can simply copy and past the output of `cat ec_public.pem`.
**Voila!** Hopefully walking through a manual verification has helped give you a better feel for how signed JWT tokens are used as a secondary validation mechanism in pomerium.
0 commit comments