SocialLogin.Client.Blazor 1.0.7

SocialLogin.Client.Blazor

Components for the Blazor Client or MVC Razor Pages

How to use

builder.Services.AddSocialLoginBlazorServices( 
    userEndpoints => builder.Configuration.GetSection(UserEndpointsOptions.SectionKey).Bind(userEndpoints),
    appOptions => builder.Configuration.GetSection(AppOptions.SectionKey).Bind(appOptions));
builder.Services.AddSocialLoginMessasgeLocalizer();

In appsetting.json add

{
  "UserEndpoints": {
    "WebApiBaseAddress": "https://domain.com"
  },
  "appoptions": {
    "AuthorizationEndpoint": "https://domain.com/oauth2/authorize",
    "ClientId": "DDLive",
    "RedirectUri": "https://domain.com/oauth2/callback",
    "TokenEndpoint": "https://domain.com/oauth2/token",
    "IDPs": [
      {
        "ProviderId": "DDLive"
      }
    ]

  }
}

Razor login component

@using SocialLogin.Client.Blazor.Components
<ExternalIDPButtonsComponent ScopeAction=ScopeAction.Login ReturnUri="dashboard" Context="Provider">
    <span class="button is-primary" @onclick="()=> IsActive = !IsActive">
        Login
    </span>
</ExternalIDPButtonsComponent>

Razor callback page

@page "/oauth2/callback"
@using SocialLogin.Client.Blazor.Components
@inherits ExternalCallBackEndpointBase

<div class="columns is-mobile">
    <div class="column has-text-centered">
        <h3>@Message</h3>
    </div>
</div>

@code {
    string Message = "Redirecting...";

    protected override void OnError(string message, IEnumerable<SocialLogin.Client.Entities.ValueObjects.MembershipError> errors)
    {
        Message = message;
    }
}

No packages depend on SocialLogin.Client.Blazor.

If not send LogOut callback then redirect to root page

Version Downloads Last updated
1.0.7 18 11/6/2024
1.0.6 14 11/6/2024
1.0.5 12 11/6/2024
1.0.4 12 11/4/2024
1.0.3 12 11/4/2024
1.0.2 15 5/11/2024
1.0.1 13 3/21/2024
1.0.0 16 3/16/2024