Activities of "Tony_Albutt"

Hi

Are you indicating that a class like this is causing the problem?

Hello

I upgraded all ABP libraries to version 9 and then back to version 8.3.3

This enabled me to trace the error a little better

Maybe this will help?

This causes the system to crash

Looks interesting 😁

Thanks Shiwei

Hello Shiwei

There may be an issue causing the problem

I have not hidden any application Endpoints from swagger. I have many Application services that are API calls to external systems.

Could this be causing the issue?

Thanks and regards Tony

Hi

My test application works, the one that was created 5 years ago does not. That one was created with version 3 and migrated to version 4,5,6,7 and then 8. I don't think that it is possible for me to follow the above steps with a new test application.

Cool, what makes my API available to the abp generate-proxy command

My API is available, to Swagger.

After the code fix " options.AddAudiences("ITX")

I am able to request a token using Postman I am able to Request data from the API and authenticate with the Token using Postman

I can use an second ABP application using HttpClient, and using the clientid = ITX and ITX_App from above, Request a token using HttpClient and then request data using HttpClient and adding the token

Thanks for your assistance.

Best regards Tony

Hello Shiwei

This is the error from the PS cmd

PS F:\TestingApi\src\TestingApi.Application> abp generate-proxy -t csharp -u https://localhost:44334/ -m Integration

[08:44:00 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli System.Net.Http.HttpRequestException: An error occurred while sending the request. System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.. System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host. at void System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at int System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System .Int32>.GetResult(short token) at async ValueTask<int> System.Net.Security.SslStream.EnsureFullTlsFrameAsync<TIOAdapter>(CancellationToken cancellationToken, int estimatedSize) at TResult System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks. Sources.IValueTaskSource<TResult>.GetResult(short token) at async ValueTask<int> System.Net.Security.SslStream.ReadAsyncInternal<TIOAdapter>(Memory<byte> buffer, CancellationToken cancellationToken) at TResult System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks. Sources.IValueTaskSource<TResult>.GetResult(short token) at async ValueTask System.Net.Http.HttpConnection.InitialFillAsync(bool async) at async Task<HttpResponseMessage> System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) at async Task<HttpResponseMessage> System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) at async ValueTask<HttpResponseMessage> System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync( HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken) at async ValueTask<HttpResponseMessage> System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) at async Task<HttpResponseMessage> Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler. <SendCoreAsync>g__Core|5_0(HttpRequestMessage request, bool useAsync, CancellationToken cancellationToken) at async Task<HttpResponseMessage> Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler. <SendCoreAsync>g__Core|5_0(HttpRequestMessage request, bool useAsync, CancellationToken cancellationToken) at async Task<string> System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at async Task<ApplicationApiDescriptionModel> Volo.Abp.Cli.ServiceProxying.ServiceProxyGeneratorBase1. GetApplicationApiDescriptionModelAsync(GenerateProxyArgs args, ApplicationApiDescriptionModelRequestDto requestDto) at async Task Volo.Abp.Cli.ServiceProxying.CSharp.CSharpServiceProxyGenerator.GenerateProxyAsync(GenerateProxyArgs args) at async Task Volo.Abp.Cli.Commands.ProxyCommandBase1.ExecuteAsync(CommandLineArgs commandLineArgs) at async Task Volo.Abp.Studio.Cli.StudioCliService.RunInternalAsync(CommandLineArgs commandLineArgs) at async Task Volo.Abp.Studio.Cli.StudioCliService.RunAsync(string[] args) Unhandled exception. System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.. ---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host. --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async) at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.<SendCoreAsync>g__Core|5_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.<SendCoreAsync>g__Core|5_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at Volo.Abp.Cli.ServiceProxying.ServiceProxyGeneratorBase1.GetApplicationApiDescriptionModelAsync(GenerateProxyArgs args, ApplicationApiDescriptionModelRequestDto requestDto) at Volo.Abp.Cli.ServiceProxying.CSharp.CSharpServiceProxyGenerator.GenerateProxyAsync(GenerateProxyArgs args) at Volo.Abp.Cli.Commands.ProxyCommandBase`1.ExecuteAsync(CommandLineArgs commandLineArgs) at Volo.Abp.Studio.Cli.StudioCliService.RunInternalAsync(CommandLineArgs commandLineArgs) at Volo.Abp.Studio.Cli.StudioCliService.RunAsync(String[] args) at Volo.Abp.Studio.Cli.Program.IrXAxCPfc(Object ) at Volo.Abp.Studio.Cli.Program.

(String[] args)

PS F:\TestingApi\src\TestingApi.Application>

This is the exception

I have emailed you the full error log and call stack

Thanks again

All the best

Regards Tony

Thank you,

I still have my original issue 2 from above.

2 When I use the shell cmd : abp generate-proxy -t csharp -u https://localhost:44334/ my application breaks with the following error. System.StackOverflowException Looking for file /_/src/libraries/System.Private.CoreLib/src/System/Type.cs please select file.

I don't have a file called Type.cs This error may be relates to the ABP CLI command.

abp generate-proxy -t csharp -u https://localhost:44334/ -m Integration

Locating source for '//src/libraries/System.Private.CoreLib/src/System/Type.cs'. Checksum: SHA256 { e7dbd6fe331ff9a3c4b24dd470ec1f19a71b7c5acf258b81ae7f761cd2b3019b } Searching opened files... Checking if document is part of a project... Searching script documents... Searching projects... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\cvt'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\msclr'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\sys'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\x64'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\arm'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\concrt'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\i386'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\linkopts'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\stl'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\vccorlib'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\crt\src\vcruntime'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\atlmfc\src\mfc'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\atlmfc\src\atl'... Searching directory 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\atlmfc\include'... Searching directory 'F:'... Searching for documents embedded in the symbol file... Not searching Source Link (option is disabled) Not searching Source Server (option is disabled) The debugger will ask the user to find the file: //src/libraries/System.Private.CoreLib/src/System/Type.cs. The user pressed Cancel in the Find Source dialog. The debug source files settings for the active solution have been modified so that the debugger will not ask the user to find the file: //src/libraries/System.Private.CoreLib/src/System/Type.cs. The debugger could not locate the source file '//src/libraries/System.Private.CoreLib/src/System/Type.cs'.

So, for a short term solution, I will use my test solution for creating the Client Proxies for my Integration module.

I don't know how much code I will have to reproduce in the test solution, to trigger the current proxy generation problem.

Please let me know how I help.

Thanks and regards Tony

Hi

looks that I was correct, close... I suspect that I am missing a migration step when moving from IdentityServer to OpenIddict with the AddJwtBearer??

I found the issue preventing the token from been validated

options.AddAudiences("ITX"); was incorrectly updated as options.AddAudiences("ITX ");

There was a space after the ITX

            PreConfigure<OpenIddictBuilder>(builder =>
            {
                builder.AddValidation(options =>
                {
                    options.AddAudiences("ITX");
                    options.UseLocalServer();
                    options.UseAspNetCore();
                });
            });

Issues 1 and 3 seems to be resolved.

More info for issue 1, please see next comment below.

Thanks and regards Tony

I am getting a better error description now.

To me, it looks as if the application is validating the token with AzureOpen ID and not a local account.

I have removed the AddOpenIdConnect from the AddAuthentication, but still sends a request to https://login.microsoftonline.com

When I request the token via Postman,

[11:23:18 INF] The request URI matched a server endpoint: Token. [11:23:18 INF] The token request was successfully extracted: { "Content-Type": "application/json", "client_id": "ITX", "grant_type": "password", "username": "Peter", "password": "[redacted]", "client_secret": "[redacted]", "__tenant": "C0780FB1-38FB-2ABA-073B-39FD9C32D323", "scope": "address email phone roles profile ITX" }. [11:23:20 INF] The token request was successfully validated. [11:23:20 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy [11:23:20 INF] Try to use LDAP for external authentication [11:23:20 WRN] Ldap login setting is not enabled! [11:23:20 INF] Try to use OAUTH for external authentication [11:23:20 INF] Start processing HTTP request GET https://login.microsoftonline.com/■■■■■■■■■■/v2.0/.well-known/openid-configuration [11:23:20 INF] Sending HTTP request GET https://login.microsoftonline.com/■■■■■■■■■■/v2.0/.well-known/openid-configuration [11:23:21 INF] Received HTTP response headers after 1105.3241ms - 200 [11:23:21 INF] End processing HTTP request after 1105.5083ms - 200 [11:23:21 INF] Start processing HTTP request GET https://login.microsoftonline.com/■■■■■■■■■■/discovery/v2.0/keys [11:23:21 INF] Sending HTTP request GET https://login.microsoftonline.com/■■■■■■■■■■/discovery/v2.0/keys [11:23:21 INF] Received HTTP response headers after 228.885ms - 200 [11:23:21 INF] End processing HTTP request after 229.0845ms - 200 [11:23:21 INF] Start processing HTTP request POST https://login.microsoftonline.com/■■■■■■■■■■/oauth2/v2.0/token [11:23:21 INF] Sending HTTP request POST https://login.microsoftonline.com/■■■■■■■■■■/oauth2/v2.0/token [11:23:22 INF] Received HTTP response headers after 306.9007ms - 400 [11:23:22 INF] End processing HTTP request after 307.0948ms - 400 [11:23:22 ERR] Get access token error: {"error":"invalid_grant","error_description":"AADSTS50034: The user account {EUII Hidden} does not exist in the ■■■■■■■■■■ directory. To sign into this application, the account must be added to the directory. Trace ID: 3c17edc8-ae32-4387-9a83-7e18be8a6800 Correlation ID: e8b7171a-4f6a-4c87-bb88-fb920b0aeb52 Timestamp: 2024-11-25 09:23:21Z","error_codes":[50034],"timestamp":"2024-11-25 09:23:21Z","trace_id":"3c17edc8-ae32-4387-9a83-7e18be8a6800","correlation_id":"e8b7171a-4f6a-4c87-bb88-fb920b0aeb52","error_uri":"https://login.microsoftonline.com/error?code=50034"} Volo.Abp.AbpException: Get access token error: {"error":"invalid_grant","error_description":"AADSTS50034: The user account {EUII Hidden} does not exist in the ■■■■■■■■■■ directory. To sign into this application, the account must be added to the directory. Trace ID: 3c17edc8-ae32-4387-9a83-7e18be8a6800 Correlation ID: e8b7171a-4f6a-4c87-bb88-fb920b0aeb52 Timestamp: 2024-11-25 09:23:21Z","error_codes":[50034],"timestamp":"2024-11-25 09:23:21Z","trace_id":"3c17edc8-ae32-4387-9a83-7e18be8a6800","correlation_id":"e8b7171a-4f6a-4c87-bb88-fb920b0aeb52","error_uri":"https://login.microsoftonline.com/error?code=50034"} at Volo.Abp.Identity.ExternalLoginProviders.OAuth.OAuthExternalLoginManager.GetAccessTokenAsync(String userName, String password) at Volo.Abp.Identity.ExternalLoginProviders.OAuth.OAuthExternalLoginManager.AuthenticateAsync(String userName, String password) [11:23:34 INF] The response was successfully returned as a JSON document: { "access_token": "[redacted]", "token_type": "Bearer", "expires_in": 3588 }.

Postman token request

API request from postman and

Error on the application side.

[11:33:56 ERR] Get access token error: {"error":"invalid_grant","error_description":"AADSTS50034: The user account {EUII Hidden} does not exist in the ■■■■■■■■■■ directory. To sign into this application, the account must be added to the directory. Trace ID: e5a8e6d6-f5f1-42d6-8b3a-63f0e85e6c00 Correlation ID: 28167e00-042a-4561-bf7c-cbcad01ae10e Timestamp: 2024-11-25 09:33:55Z","error_codes":[50034],"timestamp":"2024-11-25 09:33:55Z","trace_id":"e5a8e6d6-f5f1-42d6-8b3a-63f0e85e6c00","correlation_id":"28167e00-042a-4561-bf7c-cbcad01ae10e","error_uri":"https://login.microsoftonline.com/error?code=50034"} Volo.Abp.AbpException: Get access token error: {"error":"invalid_grant","error_description":"AADSTS50034: The user account {EUII Hidden} does not exist in the ■■■■■■■■■■ directory. To sign into this application, the account must be added to the directory. Trace ID: e5a8e6d6-f5f1-42d6-8b3a-63f0e85e6c00 Correlation ID: 28167e00-042a-4561-bf7c-cbcad01ae10e Timestamp: 2024-11-25 09:33:55Z","error_codes":[50034],"timestamp":"2024-11-25 09:33:55Z","trace_id":"e5a8e6d6-f5f1-42d6-8b3a-63f0e85e6c00","correlation_id":"28167e00-042a-4561-bf7c-cbcad01ae10e","error_uri":"https://login.microsoftonline.com/error?code=50034"} at Volo.Abp.Identity.ExternalLoginProviders.OAuth.OAuthExternalLoginManager.GetAccessTokenAsync(String userName, String password) at Volo.Abp.Identity.ExternalLoginProviders.OAuth.OAuthExternalLoginManager.AuthenticateAsync(String userName, String password) [11:34:07 INF] The response was successfully returned as a JSON document: { "access_token": "[redacted]", "token_type": "Bearer", "expires_in": 3590 }. [11:40:27 INF] The authentication demand was rejected because the token had no valid audience. [11:40:27 INF] OpenIddict.Validation.AspNetCore was not authenticated. Failure message: An error occurred while authenticating the current request. [11:40:27 INF] The response was successfully returned as a challenge response: { "error": "invalid_token", "error_description": "The specified token cannot be used with this resource server.", "error_uri": "https://documentation.openiddict.com/errors/ID2094" }. [11:40:27 INF] AuthenticationScheme: OpenIddict.Validation.AspNetCore was challenged.

How do I make changes to the the following to prevent this issue? ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)

Best regards Tony

Hi

Firstly, thanks, I missed the -m parameter with the test application. 😊

The test project works = new version 8, the main one was created almost 5 years ago with version 3. migrating to V8

I suspect that I am missing a migration step when moving from IdentityServer to OpenIddict with the AddJwtBearer??

I added two changes that did not help

Thanks and regards Tony

Showing 11 to 20 of 74 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20