Base solution for your next web application
Open Closed

Unauthorized error when running consoleapiclient project #11356


User avatar
0
omkarchoudhari created

We are trying to run the aspnetzero ConsoleApiClient project by enabling the identity server, but we are getting an unauthorized error as shown the image below.

Can you please let us know why this error is happening ?

Aspnetzero version: 10.1.0 UI Framework: Angular


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you try changes on https://github.com/aspnetzero/aspnet-zero-core/pull/4358 and see if it fixes your problem ?

  • User Avatar
    0
    omkarchoudhari created

    Hi,

    Could you try changes on https://github.com/aspnetzero/aspnet-zero-core/pull/4358 and see if it fixes your problem ?

    Hello @ismcagdas unable to open the page. Getting not found error. Can you pls check and confirm ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Since this is a private repository, you need to have access. Could you send your GitHub username to [email protected] and we can invite you.

  • User Avatar
    0
    omkarchoudhari created

    Hi,

    Since this is a private repository, you need to have access. Could you send your GitHub username to [email protected] and we can invite you.

    Its omkarchoudhari

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Sorry, I think you are removed from GitHub accidentally. I have added you back.

    Thanks,

  • User Avatar
    0
    omkarchoudhari created

    @ismcagdas , we looked at the above link but we are getting the following error when hitting the API. Can you give an idea about what might be the cause of this error ? Thank you .


    ERROR 2022-11-30 17:45:14,910 [59 ] tion.IdentityServerAuthenticationHandler - IDX20803: Unable to obtain configuration from: 'http://localhost:44301/.well-known/openid-configuration'. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'http://localhost:44301/.well-known/openid-configuration'. ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'http://localhost:44301/.well-known/openid-configuration'. ---> 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. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveAsync(Socket socket, CancellationToken cancellationToken) at System.Net.Sockets.Socket.ReceiveAsync(Memory1 buffer, SocketFlags socketFlags, Boolean fromNetworkStream, CancellationToken cancellationToken) at System.Net.Sockets.NetworkStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async) at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetExistingTaskResult(Task1 task, TResult result) at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder1.SetResult(TResult result) at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetExistingTaskResult(Task1 task, TResult result) at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder1.SetResult(TResult result) at System.Threading.Tasks.TaskCompletionSourceWithCancellation1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.

    --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async) at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpClient.

  • User Avatar
    0
    omkarchoudhari created

    This issue is now resolved . It was a common grammatical mistake. Thanks.