Skip to content

[Blazor][Wasm] Adds a library for performing autentication in blazor webassembly applications using OIDC #18851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2020
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
3 changes: 3 additions & 0 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="$(MicrosoftAspNetCoreComponentsFormsPackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(MicrosoftAspNetCoreComponentsWebPackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="$(MicrosoftAspNetCoreApiAuthorizationIdentityServerPackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="$(MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="$(MicrosoftAspNetCoreIdentityUIPackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions eng/ProjectReferences.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ProjectReferenceProvider Include="Mono.WebAssembly.Interop" ProjectPath="$(RepoRoot)src\Components\Blazor\Mono.WebAssembly.Interop\src\Mono.WebAssembly.Interop.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Blazor.Server" ProjectPath="$(RepoRoot)src\Components\Blazor\Server\src\Microsoft.AspNetCore.Blazor.Server.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Blazor.DataAnnotations.Validation" ProjectPath="$(RepoRoot)src\Components\Blazor\Validation\src\Microsoft.AspNetCore.Blazor.DataAnnotations.Validation.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" ProjectPath="$(RepoRoot)src\Components\Blazor\WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj" />
<ProjectReferenceProvider Include="BlazorServerApp" ProjectPath="$(RepoRoot)src\Components\Samples\BlazorServerApp\BlazorServerApp.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Blazor" ProjectPath="$(RepoRoot)src\Components\Blazor\Blazor\src\Microsoft.AspNetCore.Blazor.csproj" RefProjectPath="$(RepoRoot)src\Components\Blazor\Blazor\ref\Microsoft.AspNetCore.Blazor.csproj" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@
<SystemThreadingTasksExtensionsPackageVersion>4.5.2</SystemThreadingTasksExtensionsPackageVersion>
<!-- Packages developed by @aspnet, but manually updated as necessary. -->
<LibuvPackageVersion>1.10.0</LibuvPackageVersion>
<MicrosoftAspNetCoreIdentityUIPackageVersion>3.1.0</MicrosoftAspNetCoreIdentityUIPackageVersion>
<MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>3.1.0</MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>3.1.0</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
<MicrosoftAspNetCoreApiAuthorizationIdentityServerPackageVersion>3.1.0</MicrosoftAspNetCoreApiAuthorizationIdentityServerPackageVersion>
<MicrosoftAspNetCoreComponentsAuthorizationPackageVersion>3.1.0</MicrosoftAspNetCoreComponentsAuthorizationPackageVersion>
<MicrosoftAspNetWebApiClientPackageVersion>5.2.6</MicrosoftAspNetWebApiClientPackageVersion>
<!-- Partner teams -->
<MicrosoftAzureKeyVaultPackageVersion>2.3.2</MicrosoftAzureKeyVaultPackageVersion>
Expand Down Expand Up @@ -273,6 +278,9 @@
<MicrosoftAspNetCoreComponentsFormsPackageVersion>$(MicrosoftAspNetCoreComponentsPackageVersion)</MicrosoftAspNetCoreComponentsFormsPackageVersion>
<MicrosoftAspNetCoreComponentsWebPackageVersion>$(MicrosoftAspNetCoreComponentsPackageVersion)</MicrosoftAspNetCoreComponentsWebPackageVersion>
<MicrosoftAspNetCoreMvcPackageVersion>$(MicrosoftAspNetCoreComponentsPackageVersion)</MicrosoftAspNetCoreMvcPackageVersion>
<MicrosoftAspNetCoreApiAuthorizationIdentityServerPackageVersion>$(MicrosoftAspNetCoreApiAuthorizationIdentityServerPackageVersion)</MicrosoftAspNetCoreApiAuthorizationIdentityServerPackageVersion>
<MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>$(MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion)</MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>
<MicrosoftAspNetCoreIdentityUIPackageVersion>$(MicrosoftAspNetCoreIdentityUIPackageVersion)</MicrosoftAspNetCoreIdentityUIPackageVersion>
</PropertyGroup>
<!-- Restore feeds -->
<PropertyGroup Label="Restore feeds">
Expand Down
78 changes: 78 additions & 0 deletions src/Components/Blazor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestContentPackage", "test\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Components.TestServer", "test\testassets\TestServer\Components.TestServer.csproj", "{EACC194A-8C1B-424D-B8FE-330E14CAF525}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebAssembly.Authentication", "WebAssembly.Authentication", "{C4D74173-702B-428A-B689-1A9AF51CE356}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.Authentication", "Blazor\WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj", "{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebAssembly.Authentication.Tests", "Blazor\WebAssembly.Authentication\test\Microsoft.AspNetCore.Components.WebAssembly.Authentication.Tests.csproj", "{E450CCAC-6E03-4306-9919-47AB0EE98657}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wasm.Authentication.Server", "Blazor\testassets\Wasm.Authentication.Server\Wasm.Authentication.Server.csproj", "{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wasm.Authentication.Client", "Blazor\testassets\Wasm.Authentication.Client\Wasm.Authentication.Client.csproj", "{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wasm.Authentication.Shared", "Blazor\testassets\Wasm.Authentication.Shared\Wasm.Authentication.Shared.csproj", "{A82A1C13-C452-423A-9287-A7E52F6A43E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -433,6 +445,66 @@ Global
{EACC194A-8C1B-424D-B8FE-330E14CAF525}.Release|x64.Build.0 = Release|Any CPU
{EACC194A-8C1B-424D-B8FE-330E14CAF525}.Release|x86.ActiveCfg = Release|Any CPU
{EACC194A-8C1B-424D-B8FE-330E14CAF525}.Release|x86.Build.0 = Release|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Debug|x64.ActiveCfg = Debug|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Debug|x64.Build.0 = Debug|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Debug|x86.ActiveCfg = Debug|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Debug|x86.Build.0 = Debug|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Release|Any CPU.Build.0 = Release|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Release|x64.ActiveCfg = Release|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Release|x64.Build.0 = Release|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Release|x86.ActiveCfg = Release|Any CPU
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE}.Release|x86.Build.0 = Release|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Debug|x64.ActiveCfg = Debug|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Debug|x64.Build.0 = Debug|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Debug|x86.ActiveCfg = Debug|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Debug|x86.Build.0 = Debug|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Release|Any CPU.Build.0 = Release|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Release|x64.ActiveCfg = Release|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Release|x64.Build.0 = Release|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Release|x86.ActiveCfg = Release|Any CPU
{E450CCAC-6E03-4306-9919-47AB0EE98657}.Release|x86.Build.0 = Release|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Debug|x64.ActiveCfg = Debug|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Debug|x64.Build.0 = Debug|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Debug|x86.ActiveCfg = Debug|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Debug|x86.Build.0 = Debug|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Release|Any CPU.Build.0 = Release|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Release|x64.ActiveCfg = Release|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Release|x64.Build.0 = Release|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Release|x86.ActiveCfg = Release|Any CPU
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB}.Release|x86.Build.0 = Release|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Debug|x64.ActiveCfg = Debug|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Debug|x64.Build.0 = Debug|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Debug|x86.ActiveCfg = Debug|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Debug|x86.Build.0 = Debug|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Release|Any CPU.Build.0 = Release|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Release|x64.ActiveCfg = Release|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Release|x64.Build.0 = Release|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Release|x86.ActiveCfg = Release|Any CPU
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8}.Release|x86.Build.0 = Release|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Debug|x64.ActiveCfg = Debug|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Debug|x64.Build.0 = Debug|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Debug|x86.ActiveCfg = Debug|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Debug|x86.Build.0 = Debug|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Release|Any CPU.Build.0 = Release|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Release|x64.ActiveCfg = Release|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Release|x64.Build.0 = Release|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Release|x86.ActiveCfg = Release|Any CPU
{A82A1C13-C452-423A-9287-A7E52F6A43E8}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -477,6 +549,12 @@ Global
{DA17FB91-EF6F-4C34-A5D4-1A0F7E42D699} = {10C06583-8506-42DE-863E-EAD48A1F7579}
{BC3DDF14-4961-49AB-8F19-2A23F535B0DE} = {10C06583-8506-42DE-863E-EAD48A1F7579}
{EACC194A-8C1B-424D-B8FE-330E14CAF525} = {10C06583-8506-42DE-863E-EAD48A1F7579}
{C4D74173-702B-428A-B689-1A9AF51CE356} = {B29FB58D-FAE5-405E-9695-BCF93582BE9A}
{E5C5D4E9-2442-4C4C-94E7-1EDB8ADAD1FE} = {C4D74173-702B-428A-B689-1A9AF51CE356}
{E450CCAC-6E03-4306-9919-47AB0EE98657} = {C4D74173-702B-428A-B689-1A9AF51CE356}
{B88282F3-1DEF-4B06-8AD6-5A9EF6BAFEEB} = {CBD2BB24-3EC3-4950-ABE4-8C521D258DCD}
{7EF0A33A-3E96-4DF5-973C-257CFE6F79D8} = {CBD2BB24-3EC3-4950-ABE4-8C521D258DCD}
{A82A1C13-C452-423A-9287-A7E52F6A43E8} = {CBD2BB24-3EC3-4950-ABE4-8C521D258DCD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {27A36094-AA50-4FFD-ADE6-C055E391F741}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal;
using Microsoft.Extensions.Options;

namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication
{
internal class DefaultRemoteApplicationPathsProvider<TProviderOptions> : IRemoteAuthenticationPathsProvider where TProviderOptions : class, new()
{
private readonly IOptions<RemoteAuthenticationOptions<TProviderOptions>> _options;

public DefaultRemoteApplicationPathsProvider(IOptions<RemoteAuthenticationOptions<TProviderOptions>> options)
{
_options = options;
}

public RemoteAuthenticationApplicationPathsOptions ApplicationPaths => _options.Value.AuthenticationPaths;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal
{
/// <summary>
/// This is an internal API that supports the Microsoft.AspNetCore.Components.WebAssembly.Authentication
/// infrastructure and not subject to the same compatibility standards as public APIs.
/// It may be changed or removed without notice in any release.
/// </summary>
public interface IRemoteAuthenticationPathsProvider
{
/// <summary>
/// This is an internal API that supports the Microsoft.AspNetCore.Components.WebAssembly.Authentication
/// infrastructure and not subject to the same compatibility standards as public APIs.
/// It may be changed or removed without notice in any release.
/// </summary>
RemoteAuthenticationApplicationPathsOptions ApplicationPaths { get; }
}
}
Loading