is the Angular version in the microservices template the same as the one generated in DDD projects?
How can I integrate my authentication server with an existing authentication server that does not support OAuth2?
Hi,
Could you please provide more explanation or add more details? Your response is too abstract. The problem is still persisting, and we need a solution.
Regards
We have defined the required scopes in the backoffice screen for our application (see the picture below). However, when making an HTTP request to obtain a token using the password grant type, we need to manually specify the scopes in the scope parameter of the token request. Since the scopes are already configured in the backoffice, shouldn’t they be dynamically included in the token request without requiring us to hardcode them in the code? Could you clarify how the scopes defined in the backoffice are intended to be used and whether there is a way to automatically include them in the token request?
public async Task<GetTokenResponseDto> GetTokenAsync(UserLoginInfoDto userLoginInfoDto)
{
var _client = _httpClientFactory.CreateClient();
string tokenUrl = $"{_authServerUrl}/connect/token";
FormUrlEncodedContent tokenRequest = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("grant_type","password"),
new KeyValuePair<string, string>("client_id", _configuration["AccountClient:ClientId"]),
new KeyValuePair<string, string>("client_secret", _configuration["AccountClient:ClientSecret"]),
new KeyValuePair<string, string>("username", userLoginInfoDto.UserName),
new KeyValuePair<string, string>("password", userLoginInfoDto.Password),
new KeyValuePair<string, string>("scope", " ...SCOPES.... ") //Scopes Added Here
});
HttpResponseMessage response = await _client.PostAsync(tokenUrl, tokenRequest);
response.EnsureSuccessStatusCode();
var responseContent = await response.Content.ReadAsStringAsync();
return !string.IsNullOrWhiteSpace(responseContent) ? JsonConvert.DeserializeObject<GetTokenResponseDto>(responseContent) : throw new Exception(L["EmptyResponse"]);
}
We are currently working on customizing the error messages returned by our ABP-based application in cases where exceptions occur. We have successfully implemented custom error messages for BusinessException as described in the ABP documentation. (https://abp.io/docs/latest/framework/fundamentals/exception-handling) However, we are encountering difficulties in modifying the error messages for other types of exceptions (e.g., ArgumentException, InvalidOperationException, or generic Exception) . Our goal is to provide custom error messages to the client, with multilanguage support, instead of exposing the default exception details. Specifically, we would like to know what is the recommended approach for intercepting and modifying exception messages before they are returned to the client in non-business exception scenarios?
Hello, I tried using Integration Services, i no longer get the authorization error. However, the client, after receiving the gRPC response, raises the exception :
Grpc.Core.RpcException
HResult=0x80131500
Message=Status(StatusCode="Internal", Detail="Failed to deserialize response message. The response header contains a gRPC status of OK, which means any message returned to the client for this call should be ignored. A unary or client streaming gRPC call must have a response message, which makes this response invalid.")
I want to bypass the authorization for all the calls via gRPC, from the µservices, and keep the authorization for the external calls coming from the Gateway.