Skip to content

Commit 1ab1c49

Browse files
authored
feat(templates): Retrieves keycloak claims dynamically #11837 (#11838)
1 parent 315554a commit 1ab1c49

File tree

53 files changed

+546
-754
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+546
-754
lines changed

src/Templates/Boilerplate/Bit.Boilerplate/.docs/07- ASP.NET Core Identity - Authentication & Authorization.md

Lines changed: 120 additions & 128 deletions
Large diffs are not rendered by default.

src/Templates/Boilerplate/Bit.Boilerplate/.docs/14- Response Caching System.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ The project uses the **FusionCache** library for server-side caching:
462462

463463
- **Output Cache Backend**: Powers the ASP.NET Core Output Cache implementation (Layer 4)
464464
- **Data Caching**: Provides data caching via `IFusionCache` interface for caching arbitrary data (database query results, computed values, etc.) in addition to HTTP responses
465-
- **Flexible Storage**: Supports multiple backends (in-memory, Redis, etc) for both response and data caching
465+
- **Flexible Storage**: Supports multiple backends (in-memory, Redis, hybrid etc) for both response and data caching
466466

467467
---
468468

src/Templates/Boilerplate/Bit.Boilerplate/.template.config/template.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@
233233
"parameters": {
234234
"source": "name",
235235
"toLower": true
236-
}
236+
},
237+
"replaces": "boilerplate"
237238
},
238239
"nameToAppId": {
239240
"type": "generated",

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorize.razor

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorize.razor.cs

Lines changed: 0 additions & 70 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@inherits AppComponentBase
2+
3+
<section>
4+
<BitStack Horizontal>
5+
@if (isLoadingProviders)
6+
{
7+
@for (int i = 0; i < 4; i++)
8+
{
9+
<BitShimmer Height="60px" Width="60px" Shape="BitShimmerShape.Rectangle" Background="BitColor.SecondaryBackground" />
10+
}
11+
}
12+
else
13+
{
14+
@if (supportedProviders.Contains("Keycloak"))
15+
{
16+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleKeycloak)" Title="@Localizer[AppStrings.KeycloakSignInButtonText]">
17+
<KeycloakIcon />
18+
</ExternalSignInButton>
19+
}
20+
@if (supportedProviders.Contains("Google"))
21+
{
22+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleGoogle)" Title="@Localizer[AppStrings.GoogleSignInButtonText]">
23+
<GoogleIcon />
24+
</ExternalSignInButton>
25+
}
26+
@if (supportedProviders.Contains("GitHub"))
27+
{
28+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleGitHub)" Title="@Localizer[AppStrings.GitHubSignInButtonText]">
29+
<GitHubIcon />
30+
</ExternalSignInButton>
31+
}
32+
@if (supportedProviders.Contains("Twitter"))
33+
{
34+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleTwitter)" Title="@Localizer[AppStrings.TwitterSignInButtonText]">
35+
<TwitterIcon />
36+
</ExternalSignInButton>
37+
}
38+
@if (supportedProviders.Contains("Apple"))
39+
{
40+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleApple)" Title="@Localizer[AppStrings.AppleSignInButtonText]">
41+
<AppleIcon />
42+
</ExternalSignInButton>
43+
}
44+
@if (supportedProviders.Contains("AzureAD"))
45+
{
46+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleAzureAD)" Title="@Localizer[AppStrings.AzureEntraSignInButtonText]">
47+
<AzureEntraIcon />
48+
</ExternalSignInButton>
49+
}
50+
@if (supportedProviders.Contains("Facebook"))
51+
{
52+
<ExternalSignInButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleFacebook)" Title="@Localizer[AppStrings.FacebookSignInButtonText]">
53+
<FacebookIcon />
54+
</ExternalSignInButton>
55+
}
56+
}
57+
</BitStack>
58+
</section>

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/SocialRow.razor.cs renamed to src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/ExternalIdentityProviders.razor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Boilerplate.Client.Core.Components.Pages.Identity.Components;
44

5-
public partial class SocialRow
5+
public partial class ExternalIdentityProviders
66
{
77
private bool isLoadingProviders = true;
88
private string[] supportedProviders = [];
@@ -18,7 +18,7 @@ protected override async Task OnInitAsync()
1818
{
1919
try
2020
{
21-
var providers = await IdentityController.GetSupportedSocialAuthSchemes(CurrentCancellationToken);
21+
var providers = await IdentityController.GetSupportedExternalAuthSchemes(CurrentCancellationToken);
2222
supportedProviders = providers;
2323
}
2424
finally
@@ -33,5 +33,5 @@ protected override async Task OnInitAsync()
3333
private async Task HandleApple() => await OnClick.InvokeAsync("Apple");
3434
private async Task HandleAzureAD() => await OnClick.InvokeAsync("AzureAD");
3535
private async Task HandleFacebook() => await OnClick.InvokeAsync("Facebook");
36-
private async Task HandleIdentityServerDemo() => await OnClick.InvokeAsync("IdentityServerDemo");
36+
private async Task HandleKeycloak() => await OnClick.InvokeAsync("Keycloak");
3737
}

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/SocialRow.razor.scss renamed to src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/ExternalIdentityProviders.razor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ section {
33
}
44

55
::deep {
6-
.social-button {
6+
.external-sign-in-button {
77
width: 60px;
88
height: 60px;
99
display: flex;

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/SocialButton.razor renamed to src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/ExternalSignInButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
OnClick="OnClick"
1111
Size="BitSize.Small"
1212
IsEnabled="IsWaiting is false"
13-
Class="social-button"
13+
Class="external-sign-in-button"
1414
Variant="BitVariant.Fill"
1515
ButtonType="BitButtonType.Button"
1616
Color="BitColor.SecondaryBackground">

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/Components/IdentityServerDemoIcon.razor

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)