Activities of "liangshiwei"

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.

Hi,

I will check it out.

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.

  • Create a login page
  • Remove all OidcClient and MauiAuthenticationBrowser used
  • Update ExternalAuthService, 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.

Hi.

It looks not a problem with ABP, but Blazor: See: https://github.com/dotnet/aspnetcore/issues/38842#issuecomment-1342540950

You can try this:

Configure<HubOptions>(options =>
{
    options.DisableImplicitFromServicesParameters = true;
});

We will fix it, your ticket refunded.

For now, you can try:

[ExposeServices(typeof(DynamicWidgetMarkdown))]
public class MyDynamicWidgetMarkdown : DynamicWidgetMarkdown
{
    [Inject]
    protected IOptions<AbpRemoteServiceOptions> RemoteServiceOptions { get; set; }

    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)
            });

            var baseUrl = RemoteServiceOptions.Value.RemoteServices.GetConfigurationOrDefaultOrNull(CmsKitAdminRemoteServiceConsts.RemoteServiceName).BaseUrl;
            e.File.UploadUrl = $"{baseUrl}/api/cms-kit/media/{result.Id}Placeholder.jpg";

            UploadImages.Remove(e.File.Id);
        }
    }
}

Showing 4581 to 4590 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 07, 2025, 08:20