Atividades de "andmattia"

Pergunta

Hi

In our migration process we want to convert our module develop on to Anz to abp.io

I start from angular module where I found a module sec and dev-app arc.

On root i use yarn build to create a module and after this step I use yarn add './dist/module/ to use on dev app.

I have some issue because some times my component or abp are non valid.

Exist a full example to explain all thebflow ?

Hi

Yes. ANZ 7.1.0 (NetCore 2.2).

I do the same test with lastes ANZ but I'm still focus on 7.1.0 version

Hi I start apps in this configuration:

For this configuration the endpoint on Angular via IS is https://localhost:44379/Account/login?response_type=id_token&client_id=anz_client&state=xxiEPGcW8Mx44MxvbDIz3orNCrTnFibn9ai7og7W%3BopenIdConnect%3D1&redirect_uri=https%3A%2F%2Flocalhost%3A4301%2Faccount%2Flogin&scope=openid%20profile&nonce=xxiEPGcW8Mx44MxvbDIz3orNCrTnFibn9ai7og7W

About HTTPS I don't think is the problem. ABP.IO angular app start on http://localhost:4200/ and works fine...

Below i copy&paste the log trace (is not the full stack because is too long to copy)

2022-04-04 08:34:39.193 +02:00 [INF] Request starting HTTP/2 GET https://localhost:44379/Account/login?response_type=id_token&client_id=anz_client&state=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm%3BopenIdConnect%3D1&redirect_uri=https%3A%2F%2Flocalhost%3A4301%2Faccount%2Flogin&scope=openid%20profile&nonce=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm - -
2022-04-04 08:34:39.627 +02:00 [DBG] Login Url: /Account/Login
2022-04-04 08:34:39.627 +02:00 [DBG] Login Return Url Parameter: ReturnUrl
2022-04-04 08:34:39.627 +02:00 [DBG] Logout Url: /Account/Logout
2022-04-04 08:34:39.627 +02:00 [DBG] ConsentUrl Url: /Consent
2022-04-04 08:34:39.627 +02:00 [DBG] Consent Return Url Parameter: returnUrl
2022-04-04 08:34:39.627 +02:00 [DBG] Error Url: /Account/Error
2022-04-04 08:34:39.627 +02:00 [DBG] Error Id Parameter: errorId
2022-04-04 08:34:39.841 +02:00 [INF] Executing endpoint '/Account/Login'
2022-04-04 08:34:39.885 +02:00 [INF] Route matched with {page = "/Account/Login", area = "", action = "", controller = ""}. Executing page /Account/Login
2022-04-04 08:34:39.887 +02:00 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
2022-04-04 08:34:40.104 +02:00 [INF] Executing handler method Volo.Abp.Account.Public.Web.Pages.Account.LoginModel.OnGetAsync - ModelState is "Valid"
2022-04-04 08:34:40.201 +02:00 [INF] Executed handler method OnGetAsync, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
2022-04-04 08:34:41.270 +02:00 [DBG] Added bundle 'Lepton.Global' to the page in 36.26 ms.
2022-04-04 08:34:41.327 +02:00 [DBG] Added bundle 'Lepton.Global' to the page in 8.41 ms.
2022-04-04 08:34:41.345 +02:00 [INF] Executed page /Account/Login in 1455.6307ms
2022-04-04 08:34:41.346 +02:00 [INF] Executed endpoint '/Account/Login'
2022-04-04 08:34:41.360 +02:00 [INF] Request finished HTTP/2 GET https://localhost:44379/Account/login?response_type=id_token&client_id=anz_client&state=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm%3BopenIdConnect%3D1&redirect_uri=https%3A%2F%2Flocalhost%3A4301%2Faccount%2Flogin&scope=openid%20profile&nonce=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm - - - 200 - text/html;+charset=utf-8 2166.2434ms
...

2022-04-04 08:35:04.268 +02:00 [INF] Request starting HTTP/2 POST https://localhost:44379/Account/login?response_type=id_token&client_id=anz_client&state=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm%3BopenIdConnect%3D1&redirect_uri=https%3A%2F%2Flocalhost%3A4301%2Faccount%2Flogin&scope=openid%20profile&nonce=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm application/x-www-form-urlencoded 334
2022-04-04 08:35:04.276 +02:00 [INF] CORS policy execution failed.
2022-04-04 08:35:04.276 +02:00 [INF] Request origin https://localhost:44379 does not have permission to access the resource.
2022-04-04 08:35:04.283 +02:00 [INF] No CORS policy found for the specified request.
2022-04-04 08:35:04.284 +02:00 [INF] Executing endpoint '/Account/Login'
2022-04-04 08:35:04.284 +02:00 [INF] Route matched with {page = "/Account/Login", area = "", action = "", controller = ""}. Executing page /Account/Login
2022-04-04 08:35:04.284 +02:00 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
2022-04-04 08:35:04.490 +02:00 [INF] Executing handler method Volo.Abp.Account.Public.Web.Pages.Account.LoginModel.OnPostAsync - ModelState is "Valid"
2022-04-04 08:35:04.613 +02:00 [INF] Try to use LDAP for external authentication
2022-04-04 08:35:04.618 +02:00 [WRN] Ldap login feature is not enabled!
2022-04-04 08:35:07.022 +02:00 [DBG] Augmenting SignInContext
2022-04-04 08:35:07.023 +02:00 [DBG] Adding idp claim with value: local
2022-04-04 08:35:07.023 +02:00 [DBG] Adding auth_time claim with value: 1649054107
2022-04-04 08:35:07.031 +02:00 [INF] AuthenticationScheme: Identity.Application signed in.
2022-04-04 08:35:07.259 +02:00 [DBG] Added 0 entity changes to the current audit log
2022-04-04 08:35:07.275 +02:00 [DBG] Added 0 entity changes to the current audit log
2022-04-04 08:35:07.294 +02:00 [INF] {"Username":"admin","Provider":null,"ProviderUserId":null,"SubjectId":"8f9cbffc-a286-ffd5-3954-3a02d3218485","DisplayName":"admin","Endpoint":"UI","ClientId":null,"Category":"Authentication","Name":"User Login Success","EventType":"Success","Id":1000,"Message":null,"ActivityId":"0HMGM0KORJFEB:00000013","TimeStamp":"2022-04-04T06:35:07.0000000Z","ProcessId":36356,"LocalIpAddress":"::1:44379","RemoteIpAddress":"::1","$type":"UserLoginSuccessEvent"}
2022-04-04 08:35:07.294 +02:00 [INF] Executed handler method OnPostAsync, returned result Microsoft.AspNetCore.Mvc.RedirectResult.
2022-04-04 08:35:07.295 +02:00 [DBG] Added 0 entity changes to the current audit log
2022-04-04 08:35:07.296 +02:00 [INF] Executing RedirectResult, redirecting to /.
2022-04-04 08:35:07.296 +02:00 [INF] Executed page /Account/Login in 3011.8957ms
2022-04-04 08:35:07.296 +02:00 [INF] Executed endpoint '/Account/Login'
2022-04-04 08:35:07.297 +02:00 [DBG] Added 0 entity changes to the current audit log
2022-04-04 08:35:07.503 +02:00 [DBG] Added 0 entity changes to the current audit log
2022-04-04 08:35:07.503 +02:00 [DBG] Added 0 entity changes to the current audit log
2022-04-04 08:35:07.511 +02:00 [INF] Request finished HTTP/2 POST https://localhost:44379/Account/login?response_type=id_token&client_id=anz_client&state=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm%3BopenIdConnect%3D1&redirect_uri=https%3A%2F%2Flocalhost%3A4301%2Faccount%2Flogin&scope=openid%20profile&nonce=LhrF5VqDmgShGSgOzV6LYPlPve1I2z3E9qraHfLm application/x-www-form-urlencoded 334 - 302 0 - 3242.9496ms

If you look into the log the redirect say

[08:40:29 INF] Executing RedirectResult, redirecting to /.

And not URL indecated on redirect_uri

Hi @gterdem

to reproduce this issue I write the steps:

  • create an empty solution on ANZ (.NetCore + Angular Vs 7.1.0)
  • create an empty solution on ABP pro (v 5.1.4) + UI Angular
  • enable OpenId on ANZ (in prev post you can see our configuration)
  • enable option on IS in ABP.IO solution
  • start Angualr+API (ANZ)+IS(ABP.IO)
  • Try to login from Angular (ANZ)

Our situation is this:

  • Login redirect to IS
  • Do login process correctly
  • No rederiction on ANZ site

Let me know if you need more information

Hi @albert

I tried with Https but situation still the same.

So I'm not agree with your answer "is related to a 3rd party component".

My question is releted how ANZ and ABP.IO can comunicate. I think is a big point to allow project migration from ANZ to ABP for many customer and is not cover in any guide or document at the moment.

I sended a full empty solution based on ANZ and ABP (without our customization) at @info to give you all information and data to try this issue.

Any way I write to info to get a quotation for this issue

Hi

could you please give us support on this issue?

Any update?

Hi all

I spent my last 3 days to try to identify why this not work.

I start from scracth again with 2 clean solution ANZ 7.1 and ABP.IO 5.1.4 and I'm able to send my login to ABP.IO page but the flow not works. This is the configuration In ANZ we put this configuration

    "OpenId": {
      "IsEnabled": "true",
      "ClientId": "anz_client",
      "Authority": "https://localhost:44379/",
      "LoginUrl": "https://localhost:44379/Account/Login",
      "ValidateIssuer": "false",
      "ClaimsMapping": [
        {
          "claim": "unique_name",
          "key": "preferred_username"
        }
      ]
    },

Go to login for default tenant we are redirect to https://localhost:44379/Account/Login?response_type=id_token&client_id=anz_client&state=dhMpK2WQPQWaY2fovyS9jhWyk3DXQceDYJ7Ff1WB%3BopenIdConnect%3D1&redirect_uri=http%3A%2F%2Flocalhost%3A4300%2Faccount%2Flogin&scope=openid%20profile&nonce=dhMpK2WQPQWaY2fovyS9jhWyk3DXQceDYJ7Ff1WB And no return happen

I check the link generate from ABP.IO angular https://localhost:44379/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fresponse_type%3Dcode%26client_id%3DTest_App%26state%3DUHFYMlJ2TEx2ckt-V3BfdFN0LUNWVHRpZ2tmWVZiTTdvVnFVNEp6LkE4NXln%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A4200%26scope%3Dopenid%2520offline_access%2520Test%26code_challenge%3DaXtCQgVDgqr52DYoXZgL2-cktwkxIrmcCLTHf2Dtin0%26code_challenge_method%3DS256%26nonce%3DUHFYMlJ2TEx2ckt-V3BfdFN0LUNWVHRpZ2tmWVZiTTdvVnFVNEp6LkE4NXln%26culture%3Den%26ui-culture%3Den

I see some differnce

  • ReturnUrl is missed on ANZ
  • response_type code vs id_token

I hope is enough to investigate why doesn't work

Responder

I found the problem.

My base class inherit from DomainService and it's ITransientDependency

Pergunta
  • ABP Framework version: lastest
  • DB provider: MongoDB

Hi

we are working on a module/service that are connecto to MQTT server.

We have create a client and define it as ISingletonDependency because only one exists on our application, we set the configuration via IOptions and until here this it works fine.

At the end of domain module we add a simple to init all configuration

public override async Task OnPreApplicationInitializationAsync(ApplicationInitializationContext context)
    {
        var myService = context.ServiceProvider.GetService<BrokerClient>();
        await myService.InitializeAsync();
    }

the first execution on Receive message handler is ok and it write data on DB but the second message has all services disposed IService

    // On Init Async method
    _mqttClient.UseApplicationMessageReceivedHandler(ReceiveMessageHandler);
    


    [UnitOfWork]
    private async Task ReceiveMessageHandler(MqttApplicationMessageReceivedEventArgs arg)
    {
       ...
       //using (var scope = _serviceProvider.CreateScope())
       //{
            _logger.LogDebug(jsonString);
       //}
    }

If I run this code log works has expected but If I look into this and _serviceProvider is disposed

How can we recover the consistent state of UOW?

Mostrando 101 até 110 de 118 registros
Made with ❤️ on ABP v8.2.0-preview Updated on março 25, 2024, 15:11