这样也是可以的.
hi
Please share the password, liming.ma@volosoft.com
Thanks.
hi
I sent a project to you.
hi
This is your JWT claims:
context.Services.AddAuthentication()
.AddJwtBearer(options =>
{
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidIssuer = configuration["Jwt:Issuer"],
ValidateAudience = true,
ValidAudience = configuration["Jwt:Audience"],
ValidateLifetime = false,
ValidateIssuerSigningKey = true,
IssuerSigningKey = securityKey
};
options.MapInboundClaims = false;
});
app.UseRouting();
app.UseAuthentication();
app.UseAbpOpenIddictValidation();
//https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Microsoft/AspNetCore/Builder/ApplicationBuilderAbpJwtTokenMiddlewareExtension.cs#L8
app.Use(async (httpContext, next) =>
{
if (httpContext.User.Identity?.IsAuthenticated != true)
{
var result = await httpContext.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
if (result.Succeeded && result.Principal != null)
{
httpContext.User = result.Principal;
}
}
await next();
});
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
hi
You have set these claim types.
AbpClaimTypes.UserName
AbpClaimTypes.Name
AbpClaimTypes.SurName
AbpClaimTypes.UserId
AbpClaimTypes.Role
AbpClaimTypes.Email
https://github.com/abpframework/abp/blob/dev/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/AbpOpenIddictAspNetCoreModule.cs#L41-L53
hi
Does this affect your UI? Or is it just in the logs?
这是EF Core 8 的一个bug
请关注 https://github.com/dotnet/efcore/issues/32383
我会尝试找一个解决方案
这是我的到的错误日志
[11:12:11 ERR] ---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "An internal error occurred during your request!",
"details": null,
"data": {},
"validationErrors": null
}
[11:12:11 ERR] The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.
System.InvalidOperationException: The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.ConditionallyNullForeignKeyProperties(InternalEntityEntry dependentEntry, InternalEntityEntry principalEntry, IForeignKey foreignKey)