Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientSimulationDemo.HttpApi.Client.ConsoleTestApp project perhaps not working #6639

Closed
niufwshd opened this issue Dec 14, 2020 · 2 comments · Fixed by abpframework/abp-samples#57
Assignees
Milestone

Comments

@niufwshd
Copy link

niufwshd commented Dec 14, 2020

  • ABP Version 4.0
  • ClientSimulationDemo solution
  • issue
    Unhandled exception. Volo.Abp.AbpException: {"error":"invalid_client"}
    at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenAsync(IdentityClientConfiguration configuration)
    at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenOrNullAsync(String identityClientName)
    at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.TryAuthenticateAsync(HttpClient client, String identityClientName)
    at Volo.Abp.Http.Client.IdentityModel.IdentityModelRemoteServiceHttpClientAuthenticator.Authenticate(RemoteServiceHttpClientAuthenticateContext context)
    at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAsync(IAbpMethodInvocation invocation) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAndGetResultAsync[T](IAbpMethodInvocation invocation)
    at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.GetResultAsync(Task task, Type resultType) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.InterceptAsync(IAbpMethodInvocation invocation)
    at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed)
    at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
    at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
    at ClientSimulationDemo.HttpApi.Client.ConsoleTestApp.ClientDemoService.RunAsync() in D:\code\execise\abp-samples-ClientSimulationDemo\test\ClientSimulationDemo.HttpApi.Client.ConsoleTestApp\ClientDemoService.cs:line 19
    at ClientSimulationDemo.HttpApi.Client.ConsoleTestApp.ConsoleTestAppHostedService.StartAsync(CancellationToken cancellationToken) in D:\code\execise\abp-samples-ClientSimulationDemo\test\ClientSimulationDemo.HttpApi.Client.ConsoleTestApp\ConsoleTestAppHostedService.cs:line 18
    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
    at ClientSimulationDemo.HttpApi.Client.ConsoleTestApp.Program.Main(String[] args) in D:\code\execise\abp-samples-ClientSimulationDemo\test\ClientSimulationDemo.HttpApi.Client.ConsoleTestApp\Program.cs:line 11
    at ClientSimulationDemo.HttpApi.Client.ConsoleTestApp.Program.(String[] args)
  • reproduce steps
    1. Download ClientSimulationDemo source code from abp-sample repository
    2. Change ClientSimulationDemo.DbMigrator and
      ClientSimulationDemo.HttpApi.Host [s appsettion.json connectstring to . (local
      computer sql server)
    3. Set ClientSimulationDemo.DbMigrator as startup project and run it,then the
      database sechema have been created successfully. finally stop it.
    4. Set ClientSimulationDemo.HttpApi.Host as startup project then run it and it
      started successfully. and I didn't stop it.
    5. Then I run all test projects and all tests have passed well.
      ClientSimulationDemo.HttpApi.Client.ConsoleTestApp is exist in test folder but it
      is not test project type.So I will manully to start it by power shell command
    6. Open a powershell window and naviage the "D:\code\execise\abp-samples-ClientSimulationDemo\test\ClientSimulationDemo.HttpApi.Client.ConsoleTestApp\bin\Debug\net5.0" and type .\ClientSimulationDemo.HttpApi.Client.ConsoleTestApp.exe
      then the error appeared.

I am not vary familar with abp,Perhaps I have missed any steps or have any wrong operating steps,please help,Thank you first!!!

@realLiangshiwei
Copy link
Member

I will check it out.

@realLiangshiwei realLiangshiwei self-assigned this Dec 15, 2020
@realLiangshiwei realLiangshiwei added this to the 4.1-preview milestone Dec 15, 2020
@realLiangshiwei
Copy link
Member

Open IdentityServerDataSeedContributor class and change MyProjectName_App:RootUrl to ClientSimulationDemo_App:RootUrl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants