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
OKTA-319837 ASP.NET Core (2.x and 3.x) Samples > Update samples and instructions to use https
For all the projects besides resource servers which should be changed together with JS samples:
* Included configuration files to make sure https is used and port numbers match the descriptions.
* READMEs were changed accordingly and extended with information about SameSite restrictions.
Copy file name to clipboardexpand all lines: samples-aspnetcore-2x/okta-hosted-login/README.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,15 @@ Run the example with your preferred tool and write down the port of your web app
21
21
22
22
> **NOTE:** This sample is using ASP.NET Core 2.2 which enforces HTTPS. This is a recommended practice for web applications. Check out [Enforce HTTPS in ASP.NET Core] for more details.
23
23
24
+
> Because of recent changes in Set-Cookie behavior (SameSite) this code will only work properly if it's configured to use https.
25
+
24
26
#### Run the web application from Visual Studio
25
27
26
-
If you run this project in Visual Studio it will start the web application on ports 5000 for HTTP and 44314 for HTTPS. You can change this configuration in the `launchSettings.json`.
28
+
If you run this project in Visual Studio it will start the web application on port 44314 and using HTTPS. You can change this configuration in the `launchSettings.json`.
27
29
28
30
#### Run the web application from dotnet CLI
29
31
30
-
If you run this project via the dotnet CLI it will start the web application on ports 5000 for HTTP and 5001 for HTTPS. You can change this configuration in the `launchSettings.json`.
32
+
If you run this project via the dotnet CLI it will start the web application on ports 5001 and using HTTPS. You can change this configuration in the `launchSettings.json`.
31
33
32
34
Navigate to the folder where the project file is located and type the following:
Copy file name to clipboardexpand all lines: samples-aspnetcore-2x/self-hosted-login/README.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,15 @@ Run the example with your preferred tool and write down the port of your web app
21
21
22
22
> **NOTE:** This sample is using ASP.NET Core 2.2 which enforces HTTPS. This is a recommended practice for web applications. Check out [Enforce HTTPS in ASP.NET Core] for more details.
23
23
24
+
> Because of recent changes in Set-Cookie behavior (SameSite) this code will only work properly if it's configured to use https.
25
+
24
26
#### Run the web application from Visual Studio
25
27
26
-
If you run this project in Visual Studio it will start the web application on ports 5000 for HTTP and 44314 for HTTPS. You can change this configuration in the `launchSettings.json`.
28
+
If you run this project in Visual Studio it will start the web application on port 44314 using HTTPS. You can change this configuration in the `launchSettings.json`.
27
29
28
30
#### Run the web application from dotnet CLI
29
31
30
-
If you run this project via the dotnet CLI it will start the web application on ports 5000 for HTTP and 5001 for HTTPS. You can change this configuration in the `launchSettings.json`.
32
+
If you run this project via the dotnet CLI it will start the web application on port 5001 using HTTPS. You can change this configuration in the `launchSettings.json`.
31
33
32
34
Navigate to the folder where the project file is located and type the following:
33
35
@@ -44,7 +46,7 @@ Go to your [Okta Developer Console] and update the following parameters in your
44
46
***Login redirect URI** - for example, `https://localhost:5001/authorization-code/callback`
45
47
***Logout redirect URI** - for example, `https://localhost:5001/signout/callback`
46
48
47
-
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origin** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
49
+
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origins** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
48
50
49
51
For step-by-step instructions, visit the Okta [Sign Users in to Your Web Application guide] which will show you how to sign users in using Okta and, [Sign Users Out guide] which will show you how to sign users out of your app and out of Okta.
Copy file name to clipboardexpand all lines: samples-aspnetcore-2x/social-login/README.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,15 @@ Run the example with your preferred tool and write down the port of your web app
22
22
23
23
> **Note:** This sample is using ASP.NET Core 2.2 which enforces HTTPS. This is a recommended practice for web applications. Check out [Enforce HTTPS in ASP.NET Core] for more details.
24
24
25
+
> Because of recent changes in Set-Cookie behavior (SameSite) this code will only work properly if it's configured to use https.
26
+
25
27
#### Run the web application from Visual Studio
26
28
27
-
If you run this project in Visual Studio it will start the web application on ports 5000 for HTTP and 44314 for HTTPS. You can change this configuration in the `launchSettings.json`.
29
+
If you run this project in Visual Studio it will start the web application on port 44314 using HTTPS. You can change this configuration in the `launchSettings.json`.
28
30
29
31
#### Run the web application from dotnet CLI
30
32
31
-
If you run this project via the dotnet CLI it will start the web application on ports 5000 for HTTP and 5001 for HTTPS. You can change this configuration in the `launchSettings.json`.
33
+
If you run this project via the dotnet CLI it will start the web application on port 5001 using HTTPS. You can change this configuration in the `launchSettings.json`.
32
34
33
35
Navigate to the folder where the project file is located and type the following:
34
36
@@ -45,7 +47,7 @@ Go to your [Okta Developer Console] and update the following parameters in your
45
47
***Login redirect URI** - for example, `https://localhost:5001/authorization-code/callback`
46
48
***Logout redirect URI** - for example, `https://localhost:5001/signout/callback`
47
49
48
-
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origin** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
50
+
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origins** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
49
51
50
52
For step-by-step instructions, visit the Okta [Sign Users in to Your Web Application guide] which will show you how to sign users in using Okta and, [Sign Users Out guide] which will show you how to sign users out of your app and out of Okta.
Copy file name to clipboardexpand all lines: samples-aspnetcore-3x/okta-hosted-login/README.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,15 @@ Run the example with your preferred tool and write down the port of your web app
21
21
22
22
> **NOTE:** This sample is using ASP.NET Core 3.1 which enforces HTTPS. This is a recommended practice for web applications. Check out [Enforce HTTPS in ASP.NET Core] for more details.
23
23
24
+
> Because of recent changes in Set-Cookie behavior (SameSite) this code will only work properly if it's configured to use https.
25
+
24
26
#### Run the web application from Visual Studio
25
27
26
-
If you run this project in Visual Studio it will start the web application on ports 5000 for HTTP and 44314 for HTTPS. You can change this configuration in the `launchSettings.json`.
28
+
If you run this project in Visual Studio it will start the web application on port 44314 using HTTPS. You can change this configuration in the `launchSettings.json`.
27
29
28
30
#### Run the web application from dotnet CLI
29
31
30
-
If you run this project via the dotnet CLI it will start the web application on ports 5000 for HTTP and 5001 for HTTPS. You can change this configuration in the `launchSettings.json`.
32
+
If you run this project via the dotnet CLI it will start the web application on port 5001 using HTTPS. You can change this configuration in the `launchSettings.json`.
31
33
32
34
Navigate to the folder where the project file is located and type the following:
Copy file name to clipboardexpand all lines: samples-aspnetcore-3x/self-hosted-login/README.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,15 @@ Run the example with your preferred tool and write down the port of your web app
21
21
22
22
> **NOTE:** This sample is using ASP.NET Core 3.1 which enforces HTTPS. This is a recommended practice for web applications. Check out [Enforce HTTPS in ASP.NET Core] for more details.
23
23
24
+
> Because of recent changes in Set-Cookie behavior (SameSite) this code will only work properly if it's configured to use https.
25
+
24
26
#### Run the web application from Visual Studio
25
27
26
-
If you run this project in Visual Studio it will start the web application on ports 5000 for HTTP and 44314 for HTTPS. You can change this configuration in the `launchSettings.json`.
28
+
If you run this project in Visual Studio it will start the web application on port 44314 using HTTPS. You can change this configuration in the `launchSettings.json`.
27
29
28
30
#### Run the web application from dotnet CLI
29
31
30
-
If you run this project via the dotnet CLI it will start the web application on ports 5000 for HTTP and 5001 for HTTPS. You can change this configuration in the `launchSettings.json`.
32
+
If you run this project via the dotnet CLI it will start the web application on port 5001 using HTTPS. You can change this configuration in the `launchSettings.json`.
31
33
32
34
Navigate to the folder where the project file is located and type the following:
33
35
@@ -44,7 +46,7 @@ Go to your [Okta Developer Console] and update the following parameters in your
44
46
***Login redirect URI** - for example, `https://localhost:5001/authorization-code/callback`
45
47
***Logout redirect URI** - for example, `https://localhost:5001/signout/callback`
46
48
47
-
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origin** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
49
+
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origins** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
48
50
49
51
For step-by-step instructions, visit the Okta [Sign Users in to Your Web Application guide] which will show you how to sign users in using Okta and, [Sign Users Out guide] which will show you how to sign users out of your app and out of Okta.
Copy file name to clipboardexpand all lines: samples-aspnetcore-3x/social-login/README.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,15 @@ Run the example with your preferred tool and write down the port of your web app
22
22
23
23
> **Note:** This sample is using ASP.NET Core 3.1 which enforces HTTPS. This is a recommended practice for web applications. Check out [Enforce HTTPS in ASP.NET Core] for more details.
24
24
25
+
> Because of recent changes in Set-Cookie behavior (SameSite) this code will only work properly if it's configured to use https.
26
+
25
27
#### Run the web application from Visual Studio
26
28
27
-
If you run this project in Visual Studio it will start the web application on ports 5000 for HTTP and 44314 for HTTPS. You can change this configuration in the `launchSettings.json`.
29
+
If you run this project in Visual Studio it will start the web application on port 44314 using HTTPS. You can change this configuration in the `launchSettings.json`.
28
30
29
31
#### Run the web application from dotnet CLI
30
32
31
-
If you run this project via the dotnet CLI it will start the web application on ports 5000 for HTTP and 5001 for HTTPS. You can change this configuration in the `launchSettings.json`.
33
+
If you run this project via the dotnet CLI it will start the web application on port 5001 using HTTPS. You can change this configuration in the `launchSettings.json`.
32
34
33
35
Navigate to the folder where the project file is located and type the following:
34
36
@@ -45,7 +47,7 @@ Go to your [Okta Developer Console] and update the following parameters in your
45
47
***Login redirect URI** - for example, `https://localhost:5001/authorization-code/callback`
46
48
***Logout redirect URI** - for example, `https://localhost:5001/signout/callback`
47
49
48
-
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origin** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
50
+
Also, enable CORS to allow your self-hosted page to make an XHR to the Okta API with the Okta session cookie. To do so, click **API > Trusted Origins** in your [Okta Developer Console], and add your web application’s base URL (for example, `https://localhost:5001/`) as a **Trusted Origin**.
49
51
50
52
For step-by-step instructions, visit the Okta [Sign Users in to Your Web Application guide] which will show you how to sign users in using Okta and, [Sign Users Out guide] which will show you how to sign users out of your app and out of Okta.
0 commit comments