Käyttäjän "mgurer" toiminnot

var client = new RestClient("https://localhost:44322/connect/token"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("client_id", "DemoApplicationClient"); request.AddParameter("client_secret", "1q2w3e*"); request.AddParameter("grant_type", "password"); request.AddParameter("username", "admin"); request.AddParameter("password", "1q2w3E*"); request.AddParameter("scope", "ProductService"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);

  • ABP Framework version: v6.0.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi. I used to get access_token and refresh_token during password flow of identityserver4. I migrated app to use openiddict and defined an openiddict application(client) with password and resresh_token flows enabled.

When I try the password flow using the related application(client) and admin user, I get only access_token. Refresh token is missing.

Can you help me for that?

Thanks.

Vastaus

It works as expected on password flow.

I could not test it on refresh_token flow. I will open another ticket for that issue.

Thank for your support.

Vastaus

Hi,

I think the document is not about adding new claims to the token. It is about switching the destination of an already added claim. It helps to decide where the claim exists (idtoken or accesstoken).

The claims property of the context is a readonly array and can not be altered. Using this class, I can not add a new claim to the context but I can alter it is destination.

I need to add new claims to the context, not to alter their locations.

Thanks

Kysymys
  • ABP Framework version: v6.0.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi, there was a class named DefaultTokenService of IdentityServer4. After switching to OpendIddict, the class is missing. I used to override that class in AuthServer project and add some dynamic claims to token.

Can you suggest me a new way for the missing class?

Thanks.

Thanks.

Hi Malik,

After a bit of work, dynamic proxies works as expected. I somehow managed to run microservices with dynamic proxies.

I will be glad if any solution for afterLeptonXInitialization error is supplied.

Thanks in advance. Regars.

I have figured out the proxy problem. I added reference to product api project and inserted following code to the gatewaymodule.cs

app.MapWhen(
            ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/api-definition") ||
                   ctx.Request.Path.ToString().TrimEnd('/').Equals(""),
            app2 =>
            {
                app2.UseRouting();
                app2.UseConfiguredEndpoints();
            }
        );
        app.MapWhen(
            ctx => ctx.Request.Path.ToString().StartsWith("/metrics"),
            app2 =>
            {
                app2.UseRouting();
                app2.UseHttpMetrics();
                app2.UseConfiguredEndpoints(endpoints =>
                {
                    endpoints.MapMetrics();
                });
            }
        );

It fixed the issue.

Issue stated at step 8 can be answered. I still get the "Could not find 'afterLeptonXInitialization'" error on first run.

  • ABP Framework version: v6.0.0

  • UI type: Blazor

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace: global.js?_v=637992658989889926:66 fail: Demo.ProductService.Blazor.Pages.ProductService.Products[0] Could not found remote action for method: System.Threading.Tasks.Task1[Volo.Abp.Application.Dtos.PagedResultDto1[Demo.ProductService.Products.ProductDto]] GetListAsync(Demo.ProductService.Products.GetProductsInput) on the URL: https://localhost:44325 Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task1[Volo.Abp.Application.Dtos.PagedResultDto1[Demo.ProductService.Products.ProductDto]] GetListAsync(Demo.ProductService.Products.GetProductsInput) on the URL: https://localhost:44325 at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.<GetActionApiDescriptionModel>d__25[[Demo.ProductService.Products.IProductAppService, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.<InterceptAsync>d__24[[Demo.ProductService.Products.IProductAppService, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.<InterceptAsync>d__31[[Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1[[Demo.ProductService.Products.IProductAppService, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Volo.Abp.Http.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null],[Volo.Abp.Application.Dtos.PagedResultDto1[[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Volo.Abp.Ddd.Application.Contracts, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Castle.DynamicProxy.AsyncInterceptorBase.<ProceedAsynchronous>d__141[[Volo.Abp.Application.Dtos.PagedResultDto1[[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Volo.Abp.Ddd.Application.Contracts, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.<ProceedAsync>d__7[[Volo.Abp.Application.Dtos.PagedResultDto1[[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Volo.Abp.Ddd.Application.Contracts, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.<InterceptAsync>d__31[[Volo.Abp.Validation.ValidationInterceptor, Volo.Abp.Validation, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null],[Volo.Abp.Application.Dtos.PagedResultDto1[[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Volo.Abp.Ddd.Application.Contracts, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.BlazoriseUI.AbpCrudPageBase10.<GetEntitiesAsync>d__61[[Demo.ProductService.Products.IProductAppService, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Guid, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Demo.ProductService.Products.GetProductsInput, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductCreateDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductUpdateDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductCreateDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Demo.ProductService.Products.ProductUpdateDto, Demo.ProductService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

  • Steps to reproduce the issue: 1- Create New Project: abp new Demo -t microservice-pro -u blazor 2- Go to services\product\src\Demo.ProductService.HttpApi.Client folder 3- Edit ProductServiceHttpApiClientModule.cs, change AddStaticHttpClientProxies to AddHttpClientProxies 4- Run project, login into blozor site and click on the products tab, see the error. 5- Interestingly when you add new remoteservice path addresing the Product Service Host domainname to the appsettings file of the master blazor project, blazor site starts working. But with this method, you simply bypass the web gateway and directly communicate with product microservice. 6- Another note, updating c# client proxies using cli even does not run, gives error. So using static proxies is not on the table. Here is the error stack trace; abp generate-proxy -t csharp -u http://localhost:44361/

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.IO.IOException: The response ended prematurely. 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.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at Volo.Abp.Cli.ServiceProxying.ServiceProxyGeneratorBase1.GetApplicationApiDescriptionModelAsync(GenerateProxyArgs args) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ServiceProxying\ServiceProxyGeneratorBase.cs:line 36 at Volo.Abp.Cli.ServiceProxying.CSharp.CSharpServiceProxyGenerator.GenerateProxyAsync(GenerateProxyArgs args) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ServiceProxying\CSharp\CSharpServiceProxyGenerator.cs:line 78 at Volo.Abp.Cli.Commands.ProxyCommandBase1.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\ProxyCommandBase.cs:line 56 at Volo.Abp.Cli.CliService.RunInternalAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 167 at Volo.Abp.Cli.CliService.RunAsync(String[] args) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 75

7- I need to run blazor site with my dynamic proxied micro services. 8- Another issue is that when you set up a new project as described in step 1, and run the blazor site, app welcomes you with an error dialog. You can simply click ok to continue, but it is also annoying. Error says: Could not find 'afterLeptonXInitialization' 9- I hope you can suggest a quick solution for the problem, it took days for me to upgrade the entire solution, and I dont wish to rollback.

Vastaus

I have updated all of the scope names in the database. Removed the redis image from docker and re-installed it.

I have tested the updated scope names in a small test app, it works properly. No more scope lenght error occurs. This will give me some time, I hope you figure out a proper fix about the error till then.

Näytetään 41 - 50/54 tietueesta
Made with ❤️ on ABP v8.2.0-preview Updated on maaliskuuta 25, 2024, 15.11