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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@inherits StaticComponent

<svg width="34" height="34" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg" fill="var(--bit-clr-fg-pri)">
<g transform="scale(2.5)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.3702 13.6799L11.3702 1.67989C11.3006 1.47291 11.1652 1.29438 10.9846 1.17159C10.804 1.0488 10.5882 0.988513 10.3702 0.999896H5.63017C5.42052 0.999354 5.21598 1.0647 5.04551 1.18672C4.87504 1.30875 4.74724 1.48127 4.68015 1.67989L0.630165 13.6799C0.577646 13.8346 0.56382 13.9998 0.589943 14.1611C0.616066 14.3225 0.681335 14.4749 0.780007 14.6052C0.878678 14.7354 1.00778 14.8395 1.15598 14.9083C1.30419 14.9771 1.46699 15.0086 1.63017 14.9999H4.56016C4.76809 14.9984 4.97035 14.932 5.13883 14.8101C5.30731 14.6883 5.43363 14.5169 5.50016 14.3199L6.11015 12.5399L9.11015 14.8099C9.28448 14.9362 9.49495 15.0028 9.71018 14.9999H14.3902C14.5517 15.0052 14.7121 14.9712 14.8576 14.901C15.0032 14.8307 15.1295 14.7263 15.2259 14.5965C15.3222 14.4668 15.3856 14.3156 15.4107 14.156C15.4359 13.9963 15.422 13.833 15.3702 13.6799ZM9.75016 14.3399C9.67748 14.3399 9.60693 14.3153 9.55015 14.2699L3.90018 10.0799L3.81016 10.0099H6.81016L6.89017 9.79988L7.89017 7.26988L10.1302 13.8999C10.1482 13.9555 10.1515 14.0148 10.1399 14.072C10.1283 14.1293 10.1022 14.1826 10.064 14.2269C10.0258 14.2711 9.97689 14.3047 9.92191 14.3245C9.86694 14.3443 9.80778 14.3496 9.75016 14.3399V14.3399ZM14.4201 14.3399H10.7002C10.7749 14.1262 10.7749 13.8935 10.7002 13.6799L6.65018 1.67989H10.3702C10.4408 1.68024 10.5095 1.70258 10.5669 1.74379C10.6242 1.78501 10.6673 1.84308 10.6902 1.9099L14.7402 13.9099C14.7538 13.9597 14.756 14.012 14.7464 14.0628C14.7369 14.1136 14.7159 14.1615 14.6851 14.203C14.6542 14.2444 14.6144 14.2783 14.5685 14.302C14.5226 14.3257 14.4718 14.3387 14.4201 14.3399V14.3399Z" />
</g>
</svg>

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@inherits StaticComponent

<svg width="34" height="34" viewBox="0 0 40 40" fill="var(--bit-clr-fg-pri)" xmlns="http://www.w3.org/2000/svg">
<path d="M21.5235 15.6968C21.5458 16.6059 21.4453 17.4926 21.2222 18.3573C21.0214 19.222 20.7201 20.0534 20.3185 20.8516C19.9168 21.6276 19.4147 22.3593 18.8121 23.0466C18.2319 23.7117 17.5624 24.2992 16.8037 24.8092C15.2193 25.8734 13.4786 26.4832 11.5819 26.6383C9.68503 26.7713 7.87745 26.4388 6.15914 25.6406C5.33346 25.2415 4.56357 24.7538 3.84946 24.1773C3.15768 23.5787 2.54399 22.9135 2.00841 22.1819C1.49515 21.4502 1.05999 20.6632 0.702945 19.8206C0.368209 18.956 0.156205 18.0692 0.0669474 17.1601C0.0446373 16.9827 0.0223101 16.8164 0 16.6612C0 16.4838 0 16.3065 0 16.1291V15.6968V2.06144C0 1.48498 0.200841 0.99722 0.602524 0.598137C1.00421 0.199054 1.49515 -0.000488281 2.07536 -0.000488281C2.65558 -0.000488281 3.14652 0.199054 3.5482 0.598137C3.94988 0.99722 4.15072 1.48498 4.15072 2.06144V7.54883V7.51557C5.28883 6.67306 6.53851 6.06336 7.89976 5.68644C9.28334 5.28736 10.6893 5.1765 12.1174 5.35387C13.5233 5.53125 14.8511 5.97466 16.1008 6.68415C17.3505 7.37146 18.4105 8.28048 19.2808 9.41122C19.9725 10.3203 20.5081 11.318 20.8875 12.4043C21.2669 13.4686 21.4788 14.566 21.5235 15.6968ZM16.2012 19.7209C17.0938 18.4792 17.4844 17.0824 17.3728 15.5305C17.3281 14.7102 17.1273 13.9342 16.7703 13.2025C16.4133 12.4487 15.9446 11.7836 15.3644 11.2071C15.0743 10.941 14.7618 10.7082 14.4271 10.5087C14.1146 10.3092 13.7799 10.1208 13.4229 9.94333C12.5749 9.56641 11.6935 9.37796 10.7785 9.37796C9.86354 9.37796 8.98208 9.55534 8.13408 9.91007C7.28608 10.287 6.54966 10.808 5.92482 11.4731C5.29999 12.1383 4.83136 12.8921 4.51893 13.7346C4.11725 14.8654 4.02799 16.0182 4.25114 17.1933C4.49662 18.3685 5.00987 19.4104 5.79093 20.3195C6.39345 21.029 7.10756 21.5611 7.93324 21.9158C8.13408 22.0267 8.33492 22.1265 8.53576 22.2151C8.75891 22.3038 8.98208 22.3926 9.20523 22.4812C9.0267 22.4147 8.84819 22.3482 8.66966 22.2816C8.49113 22.193 8.31261 22.1042 8.13408 22.0156C9.53997 22.6363 10.9905 22.7361 12.4856 22.3149C13.2443 22.1154 13.9362 21.7939 14.561 21.3504C15.2082 20.907 15.7548 20.3639 16.2012 19.7209Z" />
<path d="M28.7879 12.5904C28.7879 11.7897 27.9262 11.1406 26.8632 11.1406C25.8002 11.1406 24.9385 11.7897 24.9385 12.5904V25.1553C24.9385 25.956 25.8002 26.6051 26.8632 26.6051C27.9262 26.6051 28.7879 25.956 28.7879 25.1553V12.5904Z" />
<path d="M26.8632 9.14535C27.9262 9.14535 28.7879 8.28919 28.7879 7.23307C28.7879 6.17695 27.9262 5.3208 26.8632 5.3208C25.8002 5.3208 24.9385 6.17695 24.9385 7.23307C24.9385 8.28919 25.8002 9.14535 26.8632 9.14535Z" />
<path d="M36.6534 6.91713C36.6534 6.0355 35.8666 5.3208 34.896 5.3208C33.9255 5.3208 33.1387 6.0355 33.1387 6.91713V25.0089C33.1387 25.8905 33.9255 26.6052 34.896 26.6052C35.8666 26.6052 36.6534 25.8905 36.6534 25.0089V6.91713Z" />
<path d="M37.9917 11.1738H31.9664C30.8572 11.1738 29.958 11.9555 29.958 12.9198C29.958 13.8841 30.8572 14.6658 31.9664 14.6658H37.9917C39.1009 14.6658 40.0001 13.8841 40.0001 12.9198C40.0001 11.9555 39.1009 11.1738 37.9917 11.1738Z" />
</svg>


Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

<section>
<BitStack Horizontal Alignment="BitAlignment.SpaceBetween">

@if (AppEnvironment.IsDev())
{
<SocialButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleIdentityServerDemo)" Title="@Localizer[AppStrings.IdentityServerDemoSignInButtonText]">
<IdentityServerDemoIcon />
</SocialButton>
}

<SocialButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleGoogle)" Title="@Localizer[AppStrings.GoogleSignInButtonText]">
<GoogleIcon />
</SocialButton>
Expand All @@ -14,8 +22,14 @@
<TwitterIcon />
</SocialButton>

@*
<SocialButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleApple)" Title="@Localizer[AppStrings.AppleSignInButtonText]">
<AppleIcon />
</SocialButton>

<SocialButton IsWaiting="IsWaiting" OnClick="WrapHandled(HandleAzureAD)" Title="@Localizer[AppStrings.AzureEntraSignInButtonText]">
<AzureEntraIcon />
</SocialButton>
*@
</BitStack>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ private async Task HandleAzureAD()
{
await OnClick.InvokeAsync("AzureAD");
}

private async Task HandleIdentityServerDemo()
{
await OnClick.InvokeAsync("IdentityServerDemo");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<ActionResult> SocialSignInCallback(string? returnUrl = null, i

if (user is null)
{
var name = info.Principal.FindFirstValue("preferred_username") ?? info.Principal.FindFirstValue(ClaimTypes.Name) ?? info.Principal.FindFirstValue(ClaimTypes.NameIdentifier);
var name = info.Principal.FindFirstValue("preferred_username") ?? info.Principal.FindFirstValue(ClaimTypes.Name) ?? info.Principal.FindFirstValue(ClaimTypes.NameIdentifier) ?? info.Principal.FindFirstValue("name");
// Instead of automatically creating a user here, you can navigate to the sign-up page and pass the email and phone number in the query string.

user = new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,37 @@ private static void AddIdentity(WebApplicationBuilder builder)
configuration.GetRequiredSection("Authentication:AzureAD").Bind(options);
}, openIdConnectScheme: "AzureAD");
}

// While Google, GitHub, Twitter(X), Apple and AzureAD needs account creation in their corresponding developer portals,
// and configuring the client ID and secret, the following OpenID Connect configuration is for Duende IdentityServer demo server,
// which is a public server that allows you to test Social sign-in feature without needing to configure anything.
// Note: The following demo server doesn't require licensing.
if (builder.Environment.IsDevelopment())
{
authenticationBuilder.AddOpenIdConnect("IdentityServerDemo", options =>
{
options.Authority = "https://demo.duendesoftware.com";

options.ClientId = "interactive.confidential";
options.ClientSecret = "secret";
options.ResponseType = "code";
options.ResponseMode = "query";

options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("api");
options.Scope.Add("offline_access");
options.Scope.Add("email");

options.MapInboundClaims = false;
options.GetClaimsFromUserInfoEndpoint = true;
options.SaveTokens = true;
options.DisableTelemetry = true;

options.Prompt = "login"; // Force login every time
});
}
}

private static void AddSwaggerGen(WebApplicationBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,12 @@
</data>
<data name="SignOut" xml:space="preserve">
<value>خروج از سیستم</value>
</data>
<data name="IdentityServerDemoSignInButtonText" xml:space="preserve">
<value>ورود با سرور تستی</value>
</data>
<data name="AzureEntraSignInButtonText" xml:space="preserve">
<value>ورود با Azure Entra</value>
</data>
<data name="SignOutPrompt" xml:space="preserve">
<value>آیا مطمئن هستید که می خواهید خارج شوید؟</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,12 @@ After reaching {0}, extra sign-ins will have reduced functions.</value>
</data>
<data name="AppleSignInButtonText" xml:space="preserve">
<value>Sign in with Apple</value>
</data>
<data name="IdentityServerDemoSignInButtonText" xml:space="preserve">
<value>Sign in with Test server</value>
</data>
<data name="AzureEntraSignInButtonText" xml:space="preserve">
<value>Sign in with Azure Entra</value>
</data>
<data name="SignOut" xml:space="preserve">
<value>Sign out</value>
Expand Down
Loading