|
2 | 2 |
|
3 | 3 | The following guide contains code samples in NodeJS, Python, and Java that can be used to verify the parameters in the redirect. |
4 | 4 |
|
5 | | -<InlineAlert slots="text"/> |
6 | | - |
7 | | -Note: Always verify the `state`, `nonce`, and signature of the ID token on the backend. Do not expose this logic client-side. |
8 | | - |
| 5 | +All of the code samples on this page assume that the user's session id is stored in browser cookies (`Secure`, `HttpOnly`, and `SameSite=Strict`). Therefore, the session id will be easily available to the backend server because the browser will send the cookies in redirect request. |
9 | 6 |
|
10 | 7 | <InlineAlert slots="text"/> |
11 | 8 |
|
12 | | -All code samples assume that the user's session ID is stored in browser cookies. Therefore when Adobe IMS redirects back to the partner app, the backend server of the partner app receives a HTTP request with the cookies from the user's browser and can identify the user's session. |
| 9 | +Note: Always verify the `state`, `nonce`, and signature of the ID token on the backend. Do not expose this logic client-side. |
13 | 10 |
|
14 | 11 | + [NodeJS](#nodejs) |
15 | | - + [Install the required packages](#install-the-required-packages) |
16 | | - + [Verify the redirect](#verify-the-redirect) |
| 12 | + + [Install NodeJS packages](#install-nodejs-packages) |
| 13 | + + [Verify the redirect - NodeJS](#verify-the-redirect---nodejs) |
17 | 14 | + [Python](#python) |
18 | | - + [Install the required packages](#install-the-required-packages-1) |
19 | | - + [Verify the redirect](#verify-the-redirect-1) |
| 15 | + + [Install Python packages](#install-python-packages) |
| 16 | + + [Verify the redirect - Python](#verify-the-redirect---python) |
20 | 17 | + [Java](#java) |
21 | 18 | + [Add these dependencies to your pom.xml](#add-these-dependencies-to-your-pomxml) |
22 | | - + [Verify the redirect](#verify-the-redirect-2) |
23 | | - |
| 19 | + + [Verify the redirect - Java](#verify-the-redirect---java) |
24 | 20 |
|
25 | 21 | ## NodeJS |
26 | 22 |
|
27 | | -### Install the required packages |
| 23 | +### Install NodeJS packages |
28 | 24 | ```bash |
29 | 25 | npm install jsonwebtoken axios jose |
30 | 26 | ``` |
31 | 27 |
|
32 | | -### Verify the redirect |
| 28 | +### Verify the redirect - NodeJS |
33 | 29 |
|
34 | 30 | ```js |
35 | 31 | const axios = require('axios'); |
@@ -127,12 +123,12 @@ async function getPublicKeyFromJwk(jwk) { |
127 | 123 |
|
128 | 124 | ## Python |
129 | 125 |
|
130 | | -### Install the required packages |
| 126 | +### Install Python packages |
131 | 127 | ```bash |
132 | 128 | pip install pyjwt requests cryptography |
133 | 129 | ``` |
134 | 130 |
|
135 | | -### Verify the redirect |
| 131 | +### Verify the redirect - Python |
136 | 132 |
|
137 | 133 | ```python |
138 | 134 | import requests |
@@ -229,7 +225,7 @@ if __name__ == "__main__": |
229 | 225 |
|
230 | 226 | ``` |
231 | 227 |
|
232 | | -### Verify the redirect |
| 228 | +### Verify the redirect - Java |
233 | 229 |
|
234 | 230 | ```java |
235 | 231 | import com.auth0.jwk.Jwk; |
|
0 commit comments