Hi,
ABP does not require HTTPS, it should work in HTTP, are you facing any specific issues?
Hi,
Could you explain the exact problem during implementation??
Hi,
This might be a problem, could you provide full steps to reproduce, I will check it. thanks
But the azure issue remains the same. I get this error on azure NET::ERR_CERT_COMMON_NAME_INVALID and 404 error.
Hi, could you share some screenshots and error log?
Hi,
Yes you need to make some changes
Idea from: https://stackoverflow.com/questions/77129117/blazor-navigationmanager-not-initialized-error
Add AppInfo class to Blazor server project.
public class AppInfo : ISingletonDependency
{
public string? CurrentUrl { get; private set; }
public void UpdateAppUrl(string url)
{
this.CurrentUrl = url;
}
}
Move AuditMessageHandler class to Blazor Server project
public class AuditMessageHandler : DelegatingHandler, ITransientDependency
{
private readonly AppInfo _appInfo;
public AuditMessageHandler(AppInfo appInfo)
{
_appInfo = appInfo;
}
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{
request.Headers.Add("screen-url", _appInfo.CurrentUrl);
return base.SendAsync(request, cancellationToken);
}
}
Add AppInfoProvider.razor to Blazor server project.
@code {
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
[Inject] private AppInfo AppInfo { get; set; } = default!;
protected override void OnInitialized()
{
NavigationManager.LocationChanged += (sender, args) =>
{
this.AppInfo.UpdateAppUrl(this.NavigationManager.Uri);
};
}
}
-------------------
Configure<AbpLayoutHookOptions>(options =>
{
options.Add(LayoutHooks.Body.First, typeof(AppInfoProvider),StandardLayouts.Application);
});
Hi,
I could not reproduce it.
Here are my steps
abp new QaTestAppService to application layerpublic class TestAppService : QaAppService
{
private readonly IOptionsMonitor<OpenIddictServerOptions> _oidcOptions;
private readonly IdentityUserManager _userManager;
public TestAppService(IOptionsMonitor<OpenIddictServerOptions> oidcOptions, IdentityUserManager userManager)
{
_oidcOptions = oidcOptions;
_userManager = userManager;
}
public async Task<string> GenerateTokenAsync()
{
var user = await _userManager.FindByNameAsync("admin");
var roles = await _userManager.GetRolesAsync(user);
var claims = new List<Claim>()
{
new Claim("sub", user.Id.ToString()),
new Claim("given_name", user.UserName),
new Claim("email", user.Email),
new Claim("tenantid", user.TenantId?.ToString() ?? ""),
new Claim("scope", "address email phone roles profile offline_access Qa") //replace Qa with yours
};
claims.AddRange(roles.Select(role => new Claim("role", role)));
var options = _oidcOptions.CurrentValue;
var descriptor = new SecurityTokenDescriptor
{
Audience = "Qa", // replace with yours,
EncryptingCredentials = options.DisableAccessTokenEncryption
? null
: options.EncryptionCredentials.First(),
Expires = null,
Subject = new ClaimsIdentity(claims,TokenValidationParameters.DefaultAuthenticationType),
IssuedAt = DateTime.UtcNow,
Issuer = "https://localhost:44356/", // replace with yours,
SigningCredentials = options.SigningCredentials.First(),
TokenType = OpenIddictConstants.JsonWebTokenTypes.AccessToken,
};
var accessToken = options.JsonWebTokenHandler.CreateToken(descriptor);
return accessToken;
}
[Authorize]
public Task<string> TestTokenAsync()
{
return Task.FromResult(CurrentUser.UserName!);
}
}
Hi,
When I use the token , the user looks anonymous!
Could you explain what exactly the problem is? I will check it.
With each new release there are new issues and challenges that arise and not being able to ask questions as those arise makes using your framework much less reasonable
Each version will have an official question: https://support.abp.io/QA/Questions/6260/Bugs--Issues-v80x If you encounter any problems, you can describe the problems you encountered under this question.
If it is an ABP bug we will refund your ticket If your ticket is not returned you can contact me.
Hi,
When I repurchased my license in April of 2023 I would have expected that count to have been reset. It is ridiculous that the question count spans all years of my continued subscription.
Sorry for that, this may be a problem, you can send an email to support@abp.io and we will check it out
Hi,
Sorry, the documentation may not be clear.
I created a new microservice called StaffService
Because it's a new service and an empty service solution, it doesn't have these.
rror: The type or namespace name 'AbpMongoDbModule' could not be found (are you missing a using directive or an assembly reference?
You need to install the Volo.Abp.MongoDb package first.