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.
Hello, I'm working on a project based on the microservices' template, when I implement the gRPC for the inter services communication, the authorization : [Authorize(IdentityPermissions.Users.Create)] blocks me when I call the service from the client µS, 401, Unauthorized. How can I solve this problem with best practices ?
Hi support,
I resolved the problem by** launching the Volo.Abp.Studio.Backend.Host.exe** (BackendUI solution) located in the path: **\AppData\Local\abp-studio\current**. This was necessary because the logs showed that Volo.Abp.Studio.UI.Host.exe couldn't connect to the backend at http://localhost:38271.
However, the issue is that every time I want to work with ABP Studio, I need to manually launch the Volo.Abp.Studio.Backend.Host.exe first. Otherwise, I get the unprompted window opening.
2024-10-11 10:18:30.310 +01:00 [INF] Downloading release file 'releases.beta.json' from 'https://abp.io/api/abp-studio/r/download/windows/releases.beta.json?arch=x64&os=win&rid=win-x64&id=abp-studio&localVersion=0.9.1'. 2024-10-11 10:18:30.311 +01:00 [INF] [VPK] Creating HttpClient for AbpIoFileDownloader 2024-10-11 10:18:30.312 +01:00 [INF] Start processing HTTP request GET https://abp.io/api/abp-studio/r/download/windows/releases.beta.json?arch=x64&os=win&rid=win-x64&id=abp-studio&localVersion=0.9.1 2024-10-11 10:18:30.312 +01:00 [INF] Sending HTTP request GET https://abp.io/api/abp-studio/r/download/windows/releases.beta.json?arch=x64&os=win&rid=win-x64&id=abp-studio&localVersion=0.9.1 2024-10-11 10:18:30.620 +01:00 [INF] Received HTTP response headers after 307.9398ms - 200 2024-10-11 10:18:30.620 +01:00 [INF] End processing HTTP request after 308.2547ms - 200 2024-10-11 10:18:30.640 +01:00 [INF] No updates, remote version (0.9.1) is not newer than current version (0.9.1) and / or downgrade is not enabled. 2024-10-11 10:18:30.641 +01:00 [INF] [VPK] No updates available. 2024-10-11 10:18:30.643 +01:00 [INF] Completed task execution: Checking for new version of ABP Studio 2024-10-11 10:18:30.643 +01:00 [INF] Starting task execution: Checking pre-requirements 2024-10-11 10:18:33.747 +01:00 [INF] CLI command executed. Command: abp cli version Working directory: C:\Users\RidaABOUZID\AppData\Local\abp-studio\current {"ExitCode":0,"IsSuccess":true,"StartTime":"2024-10-11T10:18:31.6911563+01:00","ExitTime":"2024-10-11T10:18:33.7392696+01:00","RunTime":"00:00:02.0481133","$type":"CommandResult"} 2024-10-11 10:18:34.472 +01:00 [INF] Completed task execution: Checking pre-requirements 2024-10-11 10:18:36.664 +01:00 [INF] Trying to connect to ABP Studio Backend: http://localhost:38271 2024-10-11 10:18:45.832 +01:00 [INF] Trying to connect to ABP Studio Backend: http://localhost:38271 2024-10-11 10:18:55.058 +01:00 [INF] Trying to connect to ABP Studio Backend: http://localhost:38271 2024-10-11 10:18:59.126 +01:00 [WRN] Could not connect to ABP Studio Backend! Detail: Failed to connect to StreamingHub 'IStudioBackendHub'. (Status(StatusCode="Unavailable", Detail="Error connecting to subchannel.", DebugException="System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it."))
Thanks for your reply. I tried uninstalling ABP Studio and reinstalling it, but the issue still persists