is possible to double-check if the token is the problem?
How about the IAccessTokenProvider ?
@using Volo.Abp.AspNetCore.Components.Messages
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
@inherits ComponentBase
@implements IDisposable
@code {
[Inject]
protected BlazoriseUiMessageService UiMessageService { get; set; }
[Inject]
protected NavigationManager NavigationManager { get; set; }
[Inject]
protected IAccessTokenProvider AccessTokenProvider { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
UiMessageService.MessageReceived += OnMessageReceived;
}
private async void OnMessageReceived(object sender, UiMessageEventArgs e)
{
var authState = await AccessTokenProvider.RequestAccessToken();
if (authState.Status == AccessTokenResultStatus.RequiresRedirect)
{
NavigationManager.NavigateTo("/authentication/login");
}
}
public void Dispose()
{
if (UiMessageService != null)
{
UiMessageService.MessageReceived -= OnMessageReceived;
}
}
}
hi
Try add <RedirectToLoginWhenUnauthorized /> to MainFooterComponent.razor
@using Volo.Abp.AspNetCore.Components.Messages
@inherits ComponentBase
@implements IDisposable
@code {
[Inject]
protected BlazoriseUiMessageService UiMessageService { get; set; }
[Inject]
protected NavigationManager NavigationManager { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
UiMessageService.MessageReceived += OnMessageReceived;
}
private async void OnMessageReceived(object sender, UiMessageEventArgs e)
{
if (e.Message == "Unauthorized")
{
NavigationManager.NavigateTo("/authentication/login");
}
}
public void Dispose()
{
if (UiMessageService != null)
{
UiMessageService.MessageReceived -= OnMessageReceived;
}
}
}
hi
I will check this.
RC2 released.
hi
This issue will be fixed in RC2, Your questions credits refund.
hi
Please send an email to info@abp.io Thanks.
Your question credits refund.
hi
The linked user feature has already been implemented.
You can create a new template project to see.
hi
We will improve our document. Thanks
hi
but then where do I need to make my call and with which parameters?
https://identityserver4.readthedocs.io/en/latest/ https://identityserver4.readthedocs.io/en/latest/endpoints/token.html
Should I then migrate to v6.0-RC instead and use OpenIddict?
You can consider this after 6.0 is released. it's RC for now.
One more point, as not sure I understood well: will I be able to login externally (either IdentityServer or OpenIddict) with an existing ABP user I created through my Blazor server application?
Yes. https://docs.abp.io/en/commercial/latest/modules/account#social-external-logins https://docs.abp.io/en/commercial/latest/modules/account#install-a-new-external-login