|
2 | 2 | title: Authenticate users with WS-Federation in ASP.NET Core
|
3 | 3 | author: chlowell
|
4 | 4 | description: This tutorial demonstrates how to use WS-Federation in an ASP.NET Core app.
|
| 5 | +monikerRange: '>= aspnetcore-2.1' |
5 | 6 | ms.author: wpickett
|
6 | 7 | ms.custom: mvc
|
7 | 8 | ms.date: 01/16/2019
|
8 | 9 | uid: security/authentication/ws-federation
|
9 | 10 | ---
|
10 | 11 | # Authenticate users with WS-Federation in ASP.NET Core
|
11 | 12 |
|
| 13 | +[!INCLUDE[](~/includes/not-latest-version.md)] |
| 14 | + |
12 | 15 | This tutorial demonstrates how to enable users to sign in with a WS-Federation authentication provider like Active Directory Federation Services (ADFS) or [Microsoft Entra ID](/azure/active-directory/). It uses the ASP.NET Core sample app described in [Facebook, Google, and external provider authentication](xref:security/authentication/social/index).
|
13 | 16 |
|
14 | 17 | For ASP.NET Core apps, WS-Federation support is provided by [Microsoft.AspNetCore.Authentication.WsFederation](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.WsFederation). This component is ported from [Microsoft.Owin.Security.WsFederation](https://www.nuget.org/packages/Microsoft.Owin.Security.WsFederation) and shares many of that component's mechanics. However, the components differ in a couple of important ways.
|
@@ -74,52 +77,42 @@ By default, the new middleware:
|
74 | 77 |
|
75 | 78 | 
|
76 | 79 |
|
77 |
| -:::moniker range=">= aspnetcore-2.1" |
78 |
| - |
79 | 80 | ## Use WS-Federation without ASP.NET Core Identity
|
80 | 81 |
|
81 | 82 | The WS-Federation middleware can be used without Identity. For example:
|
82 | 83 |
|
83 |
| -:::moniker-end |
84 |
| - |
85 | 84 | :::moniker range=">= aspnetcore-3.0"
|
86 | 85 |
|
87 | 86 | :::code language="csharp" source="ws-federation/samples/StartupNon31.cs" id="snippet":::
|
88 | 87 |
|
89 | 88 | :::moniker-end
|
90 | 89 |
|
91 |
| -:::moniker range=">= aspnetcore-2.1 < aspnetcore-3.0" |
| 90 | +:::moniker range="< aspnetcore-3.0" |
92 | 91 |
|
93 | 92 | :::code language="csharp" source="ws-federation/samples/StartupNon21.cs" id="snippet":::
|
94 | 93 |
|
95 | 94 | :::moniker-end
|
96 | 95 |
|
97 |
| -:::moniker range=">= aspnetcore-2.1" |
98 |
| - |
99 | 96 | ## Add WS-Federation as an external login provider for ASP.NET Core Identity
|
100 | 97 |
|
101 | 98 | * Add a dependency on [Microsoft.AspNetCore.Authentication.WsFederation](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.WsFederation) to the project.
|
102 | 99 |
|
103 | 100 | * Add WS-Federation to `Startup.ConfigureServices`:
|
104 | 101 |
|
105 |
| -:::moniker-end |
106 |
| - |
107 | 102 | :::moniker range=">= aspnetcore-3.0"
|
108 | 103 |
|
109 | 104 | :::code language="csharp" source="ws-federation/samples/Startup31.cs" id="snippet":::
|
110 | 105 |
|
111 |
| -[!INCLUDE [default settings configuration](social/includes/default-settings.md)] |
112 |
| - |
113 | 106 | :::moniker-end
|
114 | 107 |
|
115 |
| -:::moniker range=">= aspnetcore-2.1 < aspnetcore-3.0" |
| 108 | +:::moniker range="< aspnetcore-3.0" |
116 | 109 |
|
117 | 110 | :::code language="csharp" source="ws-federation/samples/Startup21.cs" id="snippet":::
|
118 | 111 |
|
119 |
| -[!INCLUDE [default settings configuration](social/includes/default-settings.md)] |
120 |
| - |
121 | 112 | :::moniker-end
|
122 | 113 |
|
| 114 | +[!INCLUDE [default settings configuration](social/includes/default-settings.md)] |
| 115 | + |
123 | 116 | ### Log in with WS-Federation
|
124 | 117 |
|
125 | 118 | Browse to the app and click the **Log in** link in the nav header. There's an option to log in with WsFederation:
|
|
0 commit comments