Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/blazor-hybrid-issue-processing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `### 🌱🐇 **_Spring is here!!_** 🐣🌻
body: `### 🏖️🌞 **_Summertime!! Woot!!_** 🏐⛵

A green dinosaur 🦖 will be along shortly to assist. *Stand-by ........*`
})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blazor-issue-processing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `### 🌱🐇 **_Spring is here!!_** 🐣🌻
body: `### 🏖️🌞 **_Summertime!! Woot!!_** 🏐⛵

*Stand-by!* ... A green dinosaur 🦖 will be along shortly to assist.`
})
Expand Down
2 changes: 0 additions & 2 deletions aspnetcore/blazor/components/js-spa-frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,6 @@ The following `Counter` component uses an `IncrementAmount` parameter to set the
`Counter.razor`:

```razor
@page "/counter"

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>
Expand Down
34 changes: 29 additions & 5 deletions aspnetcore/security/authentication/ws-federation.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,42 +74,66 @@ By default, the new middleware:

![Microsoft Entra ID: App registration properties](ws-federation/_static/AadAppIdUri.png)

:::moniker range=">= aspnetcore-2.1"

## Use WS-Federation without ASP.NET Core Identity

The WS-Federation middleware can be used without Identity. For example:

:::moniker-end

:::moniker range=">= aspnetcore-3.0"
[!code-csharp[](ws-federation/samples/StartupNon31.cs?name=snippet)]

:::code language="csharp" source="ws-federation/samples/StartupNon31.cs" id="snippet":::

:::moniker-end

:::moniker range=">= aspnetcore-2.1 < aspnetcore-3.0"
[!code-csharp[](ws-federation/samples/StartupNon21.cs?name=snippet)]

:::code language="csharp" source="ws-federation/samples/StartupNon21.cs" id="snippet":::

:::moniker-end

:::moniker range=">= aspnetcore-2.1"

## Add WS-Federation as an external login provider for ASP.NET Core Identity

* Add a dependency on [Microsoft.AspNetCore.Authentication.WsFederation](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.WsFederation) to the project.

* Add WS-Federation to `Startup.ConfigureServices`:

:::moniker-end

:::moniker range=">= aspnetcore-3.0"
[!code-csharp[](ws-federation/samples/Startup31.cs?name=snippet)]

:::code language="csharp" source="ws-federation/samples/Startup31.cs" id="snippet":::

[!INCLUDE [default settings configuration](social/includes/default-settings.md)]

:::moniker-end

:::moniker range=">= aspnetcore-2.1 < aspnetcore-3.0"
[!code-csharp[](ws-federation/samples/Startup21.cs?name=snippet)]
:::moniker-end

:::code language="csharp" source="ws-federation/samples/Startup21.cs" id="snippet":::

[!INCLUDE [default settings configuration](social/includes/default-settings.md)]

:::moniker-end

### Log in with WS-Federation

Browse to the app and click the **Log in** link in the nav header. There's an option to log in with WsFederation:

![Log in page](ws-federation/_static/WsFederationButton.png)

With ADFS as the provider, the button redirects to an ADFS sign-in page:

![ADFS sign-in page](ws-federation/_static/AdfsLoginPage.png)

With Microsoft Entra ID as the provider, the button redirects to a Microsoft Entra ID sign-in page:

![Microsoft Entra ID sign-in page](ws-federation/_static/AadSignIn.png)

A successful sign-in for a new user redirects to the app's user registration page:

![Register page](ws-federation/_static/Register.png)
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Startup(IConfiguration configuration)
public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
#region snippet
// <snippet>
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options =>
Expand All @@ -50,7 +50,7 @@ public void ConfigureServices(IServiceCollection services)

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
#endregion
// </snippet>

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public Startup(IConfiguration configuration)

public IConfiguration Configuration { get; }

#region snippet
// <snippet>
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options =>
Expand All @@ -45,7 +45,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddControllersWithViews();
services.AddRazorPages();
}
#endregion
// </snippet>

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Startup(IConfiguration configuration)

public IConfiguration Configuration { get; }

#region snippet
// <snippet>
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(sharedOptions =>
Expand Down Expand Up @@ -62,7 +62,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
template: "{controller=Home}/{action=Index}/{id?}");
});
}
#endregion
// </snippet>

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Startup(IConfiguration configuration)

public IConfiguration Configuration { get; }

#region snippet
// <snippet>
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(sharedOptions =>
Expand Down Expand Up @@ -64,6 +64,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
endpoints.MapRazorPages();
});
}
#endregion
// </snippet>
}
}
Loading