Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
70833fb
OIDC resource server: configuration and a protected resource registry…
KrzysztofPajak Oct 8, 2026
0f66cdd
OIDC resource server: canonical resource URIs, audience, authorized p…
KrzysztofPajak Oct 8, 2026
cfd1888
OIDC resource server: RFC 6750 challenges and RFC 9728 protected reso…
KrzysztofPajak Oct 8, 2026
e4fe29d
OIDC resource server: Oidc JwtBearer scheme, startup validation and m…
KrzysztofPajak Oct 8, 2026
ef88aee
OIDC resource server: pipeline tests with an in-memory signing key
KrzysztofPajak Oct 8, 2026
7b1cc26
OIDC resource server: store URL as audience base, fail-closed account…
KrzysztofPajak Oct 8, 2026
ce114a8
OIDC resource server: map the token to a customer by subject link, ve…
KrzysztofPajak Oct 8, 2026
12e5be9
OIDC resource server: admin panel, vendor and store manager condition…
KrzysztofPajak Oct 8, 2026
6768e2b
OIDC resource server: always write the ProblemDetails body of challen…
KrzysztofPajak Oct 9, 2026
f1ed29a
OIDC resource server: the token's customer becomes the customer of th…
KrzysztofPajak Oct 11, 2026
0257877
External authentication: unique index on provider and external identi…
KrzysztofPajak Oct 8, 2026
11eb95f
External authentication: identity link index unique only on MongoDB
KrzysztofPajak Oct 8, 2026
424a487
OIDC resource server: refuse system, non-registered, other-store and …
KrzysztofPajak Oct 8, 2026
98ed651
External authentication: installer creates the identity link index as…
KrzysztofPajak Oct 8, 2026
6752457
OIDC resource server: link name of the login plugin, automatic regist…
KrzysztofPajak Oct 10, 2026
677e160
Web API: accept access tokens of the OpenID Connect provider next to …
KrzysztofPajak Oct 8, 2026
e0ecb69
Web API: never fail on a malformed bearer token while routing to the …
KrzysztofPajak Oct 8, 2026
90ad302
API users with SecretKey tokens marked obsolete in favour of the OIDC…
KrzysztofPajak Oct 8, 2026
e05657f
Web API: BackendAPI switch applies to provider tokens; route asymmetr…
KrzysztofPajak Oct 8, 2026
e89211b
Docs: OIDC resource server guide with Keycloak and Zitadel, test envi…
KrzysztofPajak Oct 8, 2026
6d8dc2e
Web API: treat a bearer value that is not a JWT as no token
KrzysztofPajak Oct 9, 2026
afe6fef
OIDC: browser sign-in mode of the customer resolver - never registers…
KrzysztofPajak Oct 10, 2026
e663216
External registration: pending provider identity in the external auth…
KrzysztofPajak Oct 10, 2026
2f9f086
Docs: OIDC guide - Zitadel scope only for entitled users, compose har…
KrzysztofPajak Oct 8, 2026
db5cbbb
Login: keep a local return URL across the two-factor step
KrzysztofPajak Oct 10, 2026
937e440
Docs: OIDC guide - fixes from the end-to-end run against Keycloak 26.…
KrzysztofPajak Oct 8, 2026
ffeadc7
Registration: complete a provider sign-in on the regular form, e-mail…
KrzysztofPajak Oct 10, 2026
fbacc24
Docs: OIDC guide - a bearer value that is not a JWT gets the OIDC cha…
KrzysztofPajak Oct 9, 2026
3103099
Browser sign-in: the first link of an account with two-factor authent…
KrzysztofPajak Oct 10, 2026
67f73cb
Docs: OIDC guide - automatic registration is off by default
KrzysztofPajak Oct 10, 2026
40bd857
OpenID Connect login plugin: provider, settings, sign-in button and a…
KrzysztofPajak Oct 10, 2026
fc3a1b2
OpenID Connect login plugin: code flow with PKCE, provider identity k…
KrzysztofPajak Oct 10, 2026
241ce52
OpenID Connect login plugin: ship only the handler package, not assem…
KrzysztofPajak Oct 10, 2026
4a289a4
OpenID Connect login plugin: absolute lifetime of the pending identit…
KrzysztofPajak Oct 10, 2026
7b1858d
OpenID Connect login plugin: sign-in callback, connecting an existing…
KrzysztofPajak Oct 10, 2026
4f53226
OpenID Connect login plugin: connecting an account always needs a fre…
KrzysztofPajak Oct 10, 2026
c65592a
My account: removing an external sign-in connection works again
KrzysztofPajak Oct 10, 2026
a207a0e
OpenID Connect login plugin: warning when not configured, connecting …
KrzysztofPajak Oct 10, 2026
db6434f
OIDC resource server: resolve the audience store from the request hos…
KrzysztofPajak Oct 11, 2026
f51fb29
OIDC resource server: RFC 9728 metadata URL with the well-known segme…
KrzysztofPajak Oct 11, 2026
c611acd
OIDC resource server: 404 and a warning instead of a metadata documen…
KrzysztofPajak Oct 11, 2026
7f1a4a8
Skip store and work context setup on the protected resource metadata …
KrzysztofPajak Oct 11, 2026
30741b7
OIDC resource server: answer 503 instead of invalid_token when the au…
KrzysztofPajak Oct 11, 2026
1101972
OIDC resource server: treat a negative ClockSkewSeconds as zero inste…
KrzysztofPajak Oct 11, 2026
c0d3952
OIDC resource server: build the registry's read-only resource list once
KrzysztofPajak Oct 11, 2026
ea2c20e
OIDC resource server: leave enablement of the metadata endpoints to t…
KrzysztofPajak Oct 11, 2026
5af62c3
OIDC resource server tests: dispose request messages and RSA instances
KrzysztofPajak Oct 11, 2026
e084407
OIDC resource server: filter explicitly in the header escaping and re…
KrzysztofPajak Oct 11, 2026
fcd4cba
Merge feature/oidc-resource-server into feature/oidc-customer-mapping…
KrzysztofPajak Oct 11, 2026
0605fc6
Merge feature/oidc-module-api into feature/oidc-guides-e2e: review fi…
KrzysztofPajak Oct 11, 2026
c607833
Merge feature/oidc-customer-mapping into feature/oidc-module-api: rev…
KrzysztofPajak Oct 11, 2026
6c10d52
OIDC guide: audience store from the host, RFC 9728 metadata URLs, 503…
KrzysztofPajak Oct 11, 2026
3c6291a
Merge feature/oidc-guides-e2e into feature/oidc-login-core: review fi…
KrzysztofPajak Oct 11, 2026
0634eff
Merge feature/oidc-login-core into feature/oidc-login-plugin: review …
KrzysztofPajak Oct 11, 2026
be60cf3
OIDC resource server: build the work context in the store the access …
KrzysztofPajak Oct 11, 2026
964f800
Merge develop into feature/oidc-customer-mapping: #891 squash-merged
KrzysztofPajak Oct 11, 2026
ebb689f
Merge feature/oidc-customer-mapping into feature/oidc-module-api: wor…
KrzysztofPajak Oct 11, 2026
2e93760
Merge feature/oidc-module-api into feature/oidc-guides-e2e: work-cont…
KrzysztofPajak Oct 11, 2026
db68499
OIDC Web API tests: a token forwarded from the Bearer scheme pins the…
KrzysztofPajak Oct 11, 2026
1ee791b
OIDC guide: a request with an accepted token runs in the token's stor…
KrzysztofPajak Oct 11, 2026
3d30852
Merge feature/oidc-guides-e2e into feature/oidc-login-core: work-cont…
KrzysztofPajak Oct 11, 2026
4063795
Merge feature/oidc-login-core into feature/oidc-login-plugin: work-co…
KrzysztofPajak Oct 11, 2026
3495de8
OIDC: match the request store by host and port before host alone
KrzysztofPajak Oct 11, 2026
50822d7
OIDC: no root protected resource metadata for a store under a path
KrzysztofPajak Oct 11, 2026
f204ad8
OIDC: log an unknown metadata host at debug, a store without URL as w…
KrzysztofPajak Oct 11, 2026
282522d
Context middleware: skip the protected resource metadata route exactly
KrzysztofPajak Oct 11, 2026
2eb1441
OIDC: Retry-After on the 503 for an unreachable identity provider
KrzysztofPajak Oct 11, 2026
f42b5f2
OIDC tests: recovery after an identity provider outage
KrzysztofPajak Oct 11, 2026
f9c0804
OIDC tests: dispose responses and readers
KrzysztofPajak Oct 11, 2026
9bfdb88
Merge feature/oidc-module-api into feature/oidc-guides-e2e: review fo…
KrzysztofPajak Oct 11, 2026
6333561
Merge feature/oidc-customer-mapping into feature/oidc-module-api: rev…
KrzysztofPajak Oct 11, 2026
6161803
OIDC guide: forwarded headers behind TLS termination, host:port store…
KrzysztofPajak Oct 11, 2026
7ab2f19
Merge feature/oidc-guides-e2e into feature/oidc-login-core: review fo…
KrzysztofPajak Oct 11, 2026
6f54eb6
Merge feature/oidc-login-core into feature/oidc-login-plugin: review …
KrzysztofPajak Oct 11, 2026
ef527ce
OIDC tests: dispose responses in the forwarding pipeline tests
KrzysztofPajak Oct 11, 2026
2355fd3
Merge feature/oidc-module-api into feature/oidc-guides-e2e: review fo…
KrzysztofPajak Oct 11, 2026
35630d9
Merge feature/oidc-guides-e2e into feature/oidc-login-core: review fo…
KrzysztofPajak Oct 11, 2026
e607445
Merge feature/oidc-login-core into feature/oidc-login-plugin: review …
KrzysztofPajak Oct 11, 2026
537a986
External authentication: store of the linked customer
KrzysztofPajak Oct 11, 2026
9b22008
OIDC: one identity link per store when customers are registered per s…
KrzysztofPajak Oct 11, 2026
6a381c3
External authentication index: provider, identifier and store
KrzysztofPajak Oct 11, 2026
9b08fed
Merge feature/oidc-customer-mapping into feature/oidc-module-api: per…
KrzysztofPajak Oct 11, 2026
c1dae96
Merge feature/oidc-module-api into feature/oidc-guides-e2e: per-store…
KrzysztofPajak Oct 11, 2026
459e983
OIDC guide: identity links per store
KrzysztofPajak Oct 11, 2026
885a9cf
Merge feature/oidc-guides-e2e into feature/oidc-login-core: per-store…
KrzysztofPajak Oct 11, 2026
72f4ebd
OIDC sign-in: link the identity in the current store
KrzysztofPajak Oct 11, 2026
eeb9f7c
Merge feature/oidc-login-core into feature/oidc-login-plugin: per-sto…
KrzysztofPajak Oct 11, 2026
28609f5
OIDC: a link without a store to another store's customer does not blo…
KrzysztofPajak Oct 11, 2026
f76de76
Merge feature/oidc-customer-mapping into feature/oidc-module-api: per…
KrzysztofPajak Oct 11, 2026
e189dfb
Merge feature/oidc-module-api into feature/oidc-guides-e2e: per-store…
KrzysztofPajak Oct 11, 2026
449b585
Merge feature/oidc-guides-e2e into feature/oidc-login-core: per-store…
KrzysztofPajak Oct 11, 2026
4e58b16
OIDC guide: links without a store under per-store identity
KrzysztofPajak Oct 11, 2026
37d6ffd
OIDC sign-in tests: links without a store under per-store identity
KrzysztofPajak Oct 11, 2026
5264db1
Merge feature/oidc-login-core into feature/oidc-login-plugin: per-sto…
KrzysztofPajak Oct 11, 2026
a511da8
External authentication: find a linked identity by its exact identifier
KrzysztofPajak Oct 11, 2026
ac3cb12
Merge feature/oidc-customer-mapping into feature/oidc-module-api: exa…
KrzysztofPajak Oct 11, 2026
492b20e
Merge feature/oidc-module-api into feature/oidc-guides-e2e: exact ide…
KrzysztofPajak Oct 11, 2026
13119ec
Merge feature/oidc-guides-e2e into feature/oidc-login-core: exact ide…
KrzysztofPajak Oct 11, 2026
2935cc9
Merge feature/oidc-login-core into feature/oidc-login-plugin: exact i…
KrzysztofPajak Oct 11, 2026
41bb378
Enforce one OIDC identity per customer with a customer-derived link id
KrzysztofPajak Oct 11, 2026
10f54e2
Merge feature/oidc-customer-mapping into feature/oidc-module-api: one…
KrzysztofPajak Oct 11, 2026
065a26e
Merge feature/oidc-module-api into feature/oidc-guides-e2e: one OIDC …
KrzysztofPajak Oct 11, 2026
575712e
Document that the link id enforces one OIDC identity per customer
KrzysztofPajak Oct 11, 2026
cdffe55
Merge feature/oidc-guides-e2e into feature/oidc-login-core: one OIDC …
KrzysztofPajak Oct 11, 2026
e7b7f8b
Test that browser sign-in linking keeps one OIDC identity per custome…
KrzysztofPajak Oct 11, 2026
fae445a
Merge feature/oidc-login-core into feature/oidc-login-plugin: one OID…
KrzysztofPajak Oct 11, 2026
dc0bcb2
Merge develop into feature/oidc-module-api
KrzysztofPajak Oct 11, 2026
d84f81b
API users: trust only tickets the Bearer scheme issued itself, not re…
KrzysztofPajak Oct 11, 2026
3d544c3
OIDC: forward only the Web API's Bearer scheme to Oidc, not every Jwt…
KrzysztofPajak Oct 11, 2026
6d1b565
OIDC scheme selector: drop the Enabled check it is never registered w…
KrzysztofPajak Oct 11, 2026
f768c12
OIDC scheme selector: route on the signing algorithm alone, without t…
KrzysztofPajak Oct 11, 2026
6ea8c1e
OIDC scheme selector: route by the Oidc scheme's own algorithm list i…
KrzysztofPajak Oct 11, 2026
09824fe
OIDC scheme selector: parse the bearer token once and keep the routin…
KrzysztofPajak Oct 11, 2026
789718c
OIDC request customer resolver: follow the scheme selector's decision…
KrzysztofPajak Oct 11, 2026
4c70e34
OIDC: withdraw the Web API's protected resource while BackendAPI is d…
KrzysztofPajak Oct 11, 2026
abfa8ae
Web API: apply the BackendAPI kill switch before the ignore flag of A…
KrzysztofPajak Oct 11, 2026
13fb897
appsettings: deny vendors and store managers on the Web API's protect…
KrzysztofPajak Oct 11, 2026
535e85c
Web API tests: join the temp settings path instead of combining it
KrzysztofPajak Oct 11, 2026
ac081ce
Merge feature/oidc-module-api into feature/oidc-guides-e2e: review fi…
KrzysztofPajak Oct 11, 2026
0eefaf5
OIDC guide: routing by algorithm only, Web API kill switch before cus…
KrzysztofPajak Oct 11, 2026
b386fd5
Merge feature/oidc-guides-e2e into feature/oidc-login-core: review fi…
KrzysztofPajak Oct 11, 2026
db4802c
Merge feature/oidc-login-core into feature/oidc-login-plugin: review …
KrzysztofPajak Oct 11, 2026
03a26bb
Merge remote-tracking branch 'origin/develop' into feature/oidc-guide…
KrzysztofPajak Oct 11, 2026
8ca7b93
Merge feature/oidc-guides-e2e into feature/oidc-login-core: develop a…
KrzysztofPajak Oct 11, 2026
a46e3fe
Merge feature/oidc-login-core into feature/oidc-login-plugin: develop…
KrzysztofPajak Oct 11, 2026
8dbf4c9
OIDC guide: wrap long lines, Client scopes menu name; resource URI co…
KrzysztofPajak Oct 11, 2026
99ce77e
Merge branch 'feature/oidc-guides-e2e' into feature/oidc-login-core
KrzysztofPajak Oct 11, 2026
6acee48
Merge branch 'feature/oidc-login-core' into feature/oidc-login-plugin
KrzysztofPajak Oct 11, 2026
067a7db
OIDC login: check the method's availability at every step, ask for th…
KrzysztofPajak Oct 11, 2026
bbd1ca7
External registration: connect only a verified e-mail, warn when conn…
KrzysztofPajak Oct 11, 2026
836c489
Merge remote-tracking branch 'origin/feature/oidc-login-core' into fe…
KrzysztofPajak Oct 11, 2026
49f3c21
Merge develop into feature/oidc-login-plugin: #894 and #895 merged
KrzysztofPajak Oct 11, 2026
562b8d0
OIDC login: the provider sign-in is the sign-in (no store two-factor …
KrzysztofPajak Oct 11, 2026
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
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch.SystemTextJson" Version="10.0.12" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="10.0.12" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.12" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.12" />
<PackageVersion Include="Braintree" Version="5.41.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="10.0.12" />
<PackageVersion Include="System.Linq.Dynamic.Core" Version="1.7.4" />
Expand Down
1 change: 1 addition & 0 deletions GrandNode.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<Folder Name="/Plugins/">
<Project Path="src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj" />
<Project Path="src/Plugins/Authentication.Google/Authentication.Google.csproj" />
<Project Path="src/Plugins/Authentication.OpenIdConnect/Authentication.OpenIdConnect.csproj" />
<Project Path="src/Plugins/DiscountRules.Standard/DiscountRules.Standard.csproj" />
<Project Path="src/Plugins/ExchangeRate.McExchange/ExchangeRate.McExchange.csproj" />
<Project Path="src/Plugins/Payments.BrainTree/Payments.BrainTree.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using Authentication.OpenIdConnect.Models;
using Grand.Business.Core.Interfaces.Common.Configuration;
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Business.Core.Interfaces.Common.Security;
using Grand.Domain.Permissions;
using Grand.Infrastructure.Configuration;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Authentication.OpenIdConnect.Areas.Admin.Controllers;

[PermissionAuthorize(PermissionSystemName.ExternalAuthenticationMethods)]
public class OidcLoginSettingsController : BaseAdminPluginController
{
#region Ctor

public OidcLoginSettingsController(
OidcLoginSettings oidcLoginSettings,
OidcResourceServerConfig resourceServerConfig,
OidcLoginConfig oidcLoginConfig,
ITranslationService translationService,
IPermissionService permissionService,
ISettingService settingService)
{
_oidcLoginSettings = oidcLoginSettings;
_resourceServerConfig = resourceServerConfig;
_oidcLoginConfig = oidcLoginConfig;
_translationService = translationService;
_permissionService = permissionService;
_settingService = settingService;
}

#endregion

#region Fields

private readonly OidcLoginSettings _oidcLoginSettings;
private readonly OidcResourceServerConfig _resourceServerConfig;
private readonly OidcLoginConfig _oidcLoginConfig;
private readonly ITranslationService _translationService;
private readonly IPermissionService _permissionService;
private readonly ISettingService _settingService;

#endregion

#region Methods

public async Task<IActionResult> Configure()
{
if (!await _permissionService.Authorize(StandardPermission.ManageExternalAuthenticationMethods))
return AccessDeniedView();

var model = new ConfigurationModel {
Authority = _resourceServerConfig.Authority,
ClientId = _oidcLoginConfig.ClientId,
//never the secret itself
ClientSecret = _translationService.GetResource(string.IsNullOrWhiteSpace(_oidcLoginConfig.ClientSecret)
? "Plugins.ExternalAuth.OpenIdConnect.ClientSecret.NotSet"
: "Plugins.ExternalAuth.OpenIdConnect.ClientSecret.Set"),
DisplayOrder = _oidcLoginSettings.DisplayOrder
};

return View(model);
}

[HttpPost]
[AutoValidateAntiforgeryToken]
public async Task<IActionResult> Configure(ConfigurationModel model)
{
if (!await _permissionService.Authorize(StandardPermission.ManageExternalAuthenticationMethods))
return AccessDeniedView();

if (!ModelState.IsValid)
return await Configure();

_oidcLoginSettings.DisplayOrder = model.DisplayOrder;

await _settingService.SaveSetting(_oidcLoginSettings);

//now clear settings cache
await _settingService.ClearCache();

Success(_translationService.GetResource("Admin.Plugins.Saved"));

return await Configure();
}

#endregion
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@model Authentication.OpenIdConnect.Models.ConfigurationModel
@{
Layout = "_AdminLayout";
ViewBag.Title = "OpenID Connect";
}

<input id="active-menu-item" type="hidden" value="/Admin/ExternalAuthentication/Methods"/>
@* the identity provider and the client come from appsettings and are shown read-only; the secret is never shown *@
<form asp-controller="OidcLoginSettings" asp-area="Admin" asp-action="Configure" method="post">
<admin-page title="OpenID Connect" icon="bi-person-badge">
<page-actions>
<button type="submit" name="save" class="btn btn-primary">
<i class="bi bi-check-lg"></i> @Loc["Admin.Common.Save"]
</button>
</page-actions>

<div class="note note-info">
@Html.Raw(Loc["Plugins.ExternalAuth.OpenIdConnect.Description"])
</div>
<admin-card>
<div class="grand-fields grand-fields--2col">
<admin-field asp-for="Authority">
<input asp-for="Authority" type="text" disabled class="form-control text-box single-line"/>
</admin-field>
<admin-field asp-for="ClientId">
<input asp-for="ClientId" type="text" disabled class="form-control text-box single-line"/>
</admin-field>
<admin-field asp-for="ClientSecret">
<input asp-for="ClientSecret" type="text" disabled class="form-control text-box single-line"/>
</admin-field>
<admin-field asp-for="DisplayOrder" size="sm"/>
</div>
</admin-card>
</admin-page>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Grand.Web.Common
@addTagHelper *, Grand.Web

@using Microsoft.AspNetCore.Mvc.ViewFeatures
@using Grand.Infrastructure.Extensions
@using Grand.Web.Common.Localization

@inject LocService Loc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\Build\Grand.Common.props" />
<Import Project="..\..\Build\Grand.Plugin.props" />
<PropertyGroup>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\Web\Grand.Web\Plugins\Authentication.OpenIdConnect</OutputPath>
<OutDir>$(OutputPath)</OutDir>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\Web\Grand.Web\Plugins\Authentication.OpenIdConnect</OutputPath>
<OutDir>$(OutputPath)</OutDir>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
</ItemGroup>

<!--
The handler package pulls in Microsoft.IdentityModel.*, System.IdentityModel.Tokens.Jwt and
Microsoft.Bcl.Cryptography, which the host already ships (JwtBearer). Plugin assemblies are
loaded by path, so a second copy that drifts from the host's could break plugin discovery.
Only the handler package itself is copied to the plugin folder.
-->
<Target Name="KeepOnlyHandlerPackage" BeforeTargets="_CopyFilesMarkedCopyLocal;GenerateBuildDependencyFile">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != 'Microsoft.AspNetCore.Authentication.OpenIdConnect'" />
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;

namespace Authentication.OpenIdConnect.Components;

[ViewComponent(Name = "OidcLogin")]
public class OidcLoginViewComponent(IAuthenticationSchemeProvider authenticationSchemeProvider) : ViewComponent
{
public async Task<IViewComponentResult> InvokeAsync()
{
//no scheme (not configured, or not restarted since the install): a button that can only fail is not shown
if (await authenticationSchemeProvider.GetSchemeAsync(OidcLoginDefaults.AuthenticationScheme) == null)
return Content(string.Empty);

return View();
}
}
Loading
Loading