hi
Can you confirm if the Projects.Projects.View has been granted to your current user?
You can clear Redis to make sure the cache has no wrong data.
Authorization failed. These requirements were not met: PermissionRequirement: Projects.Projects.View
And can you share the access_token of the HTTP request header?
You need to depend on the AbpAccountPublicApplicationModule.
hi
You can refer to the professional document.
https://oauth.net/2/native-apps/
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
PreConfigure<OpenIddictBuilder>(builder =>
{
builder.AddValidation(options =>
{
options.AddAudiences("MyProjectName");
options.UseLocalServer();
options.UseAspNetCore();
});
});
if (!hostingEnvironment.IsDevelopment())
{
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
{
serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "00000000-0000-0000-0000-000000000000");
serverBuilder.SetIssuer(new Uri(configuration["AuthServer:Authority"]!));
});
}
}
In the production environment, you need to use a production signing certificate. ABP Framework sets up signing and encryption certificates in your application and expects an openiddict.pfx file in your application.
This certificate is already generated by ABP CLI, so most of the time you don't need to generate it yourself. However, if you need to generate a certificate, you can use the following command:
dotnet dev-certs https -v -ep openiddict.pfx -p 00000000-0000-0000-0000-000000000000
00000000-0000-0000-0000-000000000000is the password of the certificate, you can change it to any password you want.
It is recommended to use two RSA certificates, distinct from the certificate(s) used for HTTPS: one for encryption, one for signing.
For more information, please refer to: https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html#registering-a-certificate-recommended-for-production-ready-scenarios
Also, see the Configuring OpenIddict documentation for more information.
hi
Please share the logs.txt of API website.
liming.ma@volosoft.com
Good news
great.
hi
You have to get an access_token before requesting an API that needs authentication.
hi
You can get a valid and free SSL certificate for your domain.
https://www.google.com/search?q=get+a+free+ssl+certificate+from+let%27s+encrypt
hi
Please share full error stack or logs.txt
liming.ma@volosoft.com