Activities of "liangshiwei"

Hi,

Can you try this?

if (!env.IsDevelopment())
{
    app.Use((context, next) =>
    {
        context.Request.Scheme = "https";
        return next();
    });
}

maybe is a question that has a private mode?

Yes you are right.

The answer detail is :

hi

You can add cookies authentication to your API website. Issue cookies after appropriate verification.

After that, AbpHangfireAuthorizationFilter will work on the API website.

public class HomeController : AbpController
{
    public async Task<ActionResult> Index(string username, string password)
    {
        if (username == "admin" && password == "1q2w3E*")
        {
            var user = await HttpContext.RequestServices.GetRequiredService<IdentityUserManager>().FindByNameAsync(username);
            var userClaimsPrincipalFactory = HttpContext.RequestServices.GetRequiredService<IUserClaimsPrincipalFactory<Volo.Abp.Identity.IdentityUser>>();
            await HttpContext.SignInAsync("HangFireCookie", await userClaimsPrincipalFactory.CreateAsync(user!));
        }

        return Redirect("~/swagger");
    }
}

Depends On typeof(AbpIdentityAspNetCoreModule)
    <ProjectReference Include="..\..\..\..\..\..\..\abp\modules\identity\src\Volo.Abp.Identity.AspNetCore\Volo.Abp.Identity.AspNetCore.csproj" />
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
    options.Authority = configuration["AuthServer:Authority"];
    options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
    options.Audience = "_3M";
})
.AddCookie("HangFireCookie", options =>
{
    options.ExpireTimeSpan = TimeSpan.FromHours(2);
});
app.UseAuthentication();

app.Use(async (ctx, next) =>
{
    if (ctx.User.Identity?.IsAuthenticated != true)
    {
        var result = await ctx.AuthenticateAsync("HangFireCookie");
        if (result.Succeeded && result.Principal != null)
        {
            ctx.User = result.Principal;
        }
    }

    await next();
});

if (MultiTenancyConsts.IsEnabled)
{
    app.UseMultiTenancy();
}

app.UseAuthorization();

Hi,

You can try using the method change of ICurrentPrincipalAccessor:

using (_currentPrincipalAccessor.Change(new[]
       {
           new Claim(AbpClaimTypes.UserId, Guid.NewGuid().ToString()),
           new Claim(AbpClaimTypes.UserName, "testUser"),
           new Claim(AbpClaimTypes.Role, "test1")
       }))
{
    _currentUser.UserName.ShouldBe("testUser");
    _currentUser.Roles.ShouldContain("test1");
}

_currentUser.UserName.ShouldBe("admin");

I'll see if I can deploy an empty/newly templated base ABP app to Azure in order to replicate, which should eliminate the possibility that any of our logic/overrides are contributing to the issue.

Ok,

Hi,

It looks fine.

Hi,

Refresh_token is not currently not supported.

You can configure the CacheAbsoluteExpiration to 9mins: https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs#L82

It will get a new access_token in 9 minutes.

For example:

"IdentityClients": {
    "Default": {
      "GrantType": "client_credentials", 
      "ClientId": "BookStore_OrderService",
      "ClientSecret": "1q2w3e*",
      "Authority": "https://localhost:44322", 
      "Scope": "ProductService",
      "CacheAbsoluteExpiration": 540
    }
  }

Hi,

I believe this is a misoperation or someone is trying to test(crack) your website.

BTW, If you can provide reproducible steps, I will check it.

Hi,

I don't think this is a problem. For example, maybe the user's account has been deleted on the admin side when he tries to reset his password.

Usually, you can ignore it.

Hi,

Can you try dotnet clean& dotnet build -f net7.0-android?

in which version or configuration i can find that?

No such configuration. but you can create MAUI Blazor project and use it as mobile app

Showing 3371 to 3380 of 6692 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 15, 2025, 14:41