Activities of "liangshiwei"

Hi,

This is free version source code,

you can download account pro module source code: abp get-source Volo.Abp.Account.Pro

okay, : )

API log gets spammed with: +- 50 times:

2024-10-01 07:40:53Z [DBG] Get dynamic claims cache for user: c7356510-4d74-f816-9a7d-3a0624e8562a

Hi,

This should not be a problem; ABP only calls once in a HTTP request.

And you can try disable dynamic claims system to test it

context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
{
options.IsDynamicClaimsEnabled = false;
});

Hi,

You can try this

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IAbpAccessTokenProvider))]
public class MyAccessTokenProvider : HttpContextAbpAccessTokenProvider
{
    private readonly IHttpClientFactory _httpClientFactory;
    private readonly IConfiguration _configuration;
    
    public MyAccessTokenProvider(IHttpContextAccessor httpContextAccessor, IHttpClientFactory httpClientFactory, IConfiguration configuration) : base(httpContextAccessor)
    {
        _httpClientFactory = httpClientFactory;
        _configuration = configuration;
    }

    public override async Task<string?> GetTokenAsync()
    {
        var authenticationInfo = await HttpContextAccessor.HttpContext.AuthenticateAsync();
        
        var refreshToken = authenticationInfo.Properties?.GetTokenValue("refresh_token");
        var tokenString = authenticationInfo.Properties?.GetTokenValue("access_token");
        
        if (tokenString.IsNullOrWhiteSpace() || refreshToken.IsNullOrWhiteSpace())
        {
            return tokenString;
        }

        var token = new JwtSecurityTokenHandler().ReadJwtToken(tokenString);
        
        // check token expiration and refresh token if needed
        if (token.ValidTo < DateTime.UtcNow.AddMinutes(5))
        {
            var client = _httpClientFactory.CreateClient();
            
            var response = await client.RequestRefreshTokenAsync(new RefreshTokenRequest
            {
                ClientId = _configuration["AuthServer:ClientId"]!,
                ClientSecret = _configuration["AuthServer:ClientSecret"]!,
                RefreshToken = refreshToken,
                Address = _configuration["AuthServer:Authority"]!.EnsureEndsWith('/') + "connect/token"
            });
                       
            
            authenticationInfo.Properties.UpdateTokenValue(
                "access_token", response.AccessToken);
            authenticationInfo.Properties.UpdateTokenValue(
                "refresh_token", response.RefreshToken);

            return response.AccessToken;
        }
        
        return tokenString;
        
    }
}

Hi,

We will fix the problem, your ticket was refunded.

Hi

RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable  ---> System.AggregateException: One or more errors occurred. (Connection failed)  ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed

Your RabbitMQ server seems to be unavailable , can you try to make it work?

Hi,

We have document and example https://abp.io/docs/commercial/2.9/how-to/implementing-passwordless-authentication

Hi,

The services are stateless; it will not store the token.

Or you can consider to integration services https://abp.io/docs/latest/framework/api-development/integration-services

okay : )

Hi,

The JS should not send requests to the gateway. The right way is to send requests to the WEB project, which will use a Csharp proxy to send requests to the gateway.

You can remove abp.appPath.

Showing 261 to 270 of 5968 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11