Hi,
It's a problem, we will fix it in the next version. your ticket was refunded.
Please email me: shiwei.liang@volosoft.com, I will share the temporary solution code with you.
I will check it out
Hi,
Did you check this: https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/?view=aspnetcore-7.0&tabs=visual-studio#app-base-path ?
Refunded
Hi,
The ABP suite doesn't support entity UI for MAUI-Blazor yet, it will be available in the next version.
I didn't find any where within OicdClinet to set grantType password flow
It's not easy, you need a lot of work to do.
OidcClient
and MauiAuthenticationBrowser
usedExternalAuthService
, for example:public async Task<LoginResult> LoginAsync(string userNameOrEmailAddress, string password)
{
var client = _httpClientFactory.CreateClient();
var discoveryDocument = await client.GetDiscoveryDocumentAsync(configuration["OAuthConfig:Authority"]);
var passwordTokenRequest = new PasswordTokenRequest
{
Address = discoveryDocument.TokenEndpoint,
ClientId = configuration["OAuthConfig:ClientId"],
UserName = userNameOrEmailAddress,
Password = password,
Scope = configuration["OAuthConfig:Scope"]
};
var tokenResponse = await client.RequestPasswordTokenAsync(passwordTokenRequest);
await _myProjectNameApplicationSettingService.SetAccessTokenAsync(tokenResponse.AccessToken);
_currentUser = new ClaimsPrincipal(new ClaimsIdentity(new JwtSecurityTokenHandler().ReadJwtToken(tokenResponse.AccessToken).Claims, AuthenticationType));
UserChanged?.Invoke(_currentUser);
return LoginResult.Success();
}
public async Task SignOutAsync()
{
await _myProjectNameApplicationSettingService.SetAccessTokenAsync(null);
_currentUser = new ClaimsPrincipal(new ClaimsIdentity());
UserChanged?.Invoke(_currentUser);
}
Hi,
Just we need to change type from code-flow to the password-flow in configuration and we can login without redirect to web page ?.
No, you need to create your own login page.
And update ExternalAuthService
to use password flow instead of oidcClient
Hi,
Yes, you can.
We use code flow by default, but if you want, you can use the password flow
You can check this to know how to get access token with password flow:https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs#L61-L69
Hi,
Sorry, I thought you were using Blazor webassembly.
try:
[ExposeServices(typeof(DynamicWidgetMarkdown))]
public class MyDynamicWidgetMarkdown : DynamicWidgetMarkdown
{
protected override async Task OnImageUploadChangedAsync(FileChangedEventArgs e)
{
try
{
if (e.Files.Length > 1)
{
return;
}
foreach (var file in e.Files)
{
UploadImages[file.Id] = new MemoryStream();
await file.WriteToStreamAsync(UploadImages[file.Id]);
if (!Value.IsNullOrWhiteSpace())
{
await MarkdownRef.SetValueAsync(Value.Replace("Placeholder.jpg", string.Empty));
}
}
}
catch (Exception exception)
{
await HandleErrorAsync(exception);
}
}
protected override async Task OnImageUploadEndedAsync(FileEndedEventArgs e)
{
using (var stream = UploadImages[e.File.Id])
{
stream.Position = 0;
var result = await MediaDescriptorAdminAppService.CreateAsync(BlogPostConsts.EntityType, new CreateMediaInputWithStream
{
Name = e.File.Name,
File = new RemoteStreamContent(stream, e.File.Name, e.File.Type)
});
e.File.UploadUrl = $"/api/cms-kit/media/{result.Id}Placeholder.jpg";
UploadImages.Remove(e.File.Id);
}
}
}
There is also a new problem when you edit a blog post, we have fixed it.