Käyttäjän "alin.berce" toiminnot

Any updates?

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v7.0.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hello,

Either documentation is missing something or there's a bug or I'm not seeing something obvious. Here are the steps:

  • add a new project using the latest abp 7.0.3 with Public web site

  • either by using abp suite or by running abp add-module Volo.Payment add the payment module.

  • this will add various packages and dependencies based on project

  • I want to use this on Public site with Stripe (but it also doesn't work on Web) so because of this I add the packages in the project file

    <PackageReference Include="Volo.Payment.Admin.Web" Version="7.0.3" /> <PackageReference Include="Volo.Payment.Stripe.Web" Version="7.0.3" /> <PackageReference Include="Volo.Payment.Web" Version="7.0.3" />

and on WebPublicModule.cs

[DependsOn(typeof(AbpPaymentWebModule))]
[DependsOn(typeof(AbpPaymentStripeWebModule))]
[DependsOn(typeof(AbpPaymentAdminWebModule))]

also add url configs

  Configure<PaymentWebOptions>(options =>
        {
            options.RootUrl = configuration["App:SelfUrl"];
            options.CallbackUrl = configuration["App:SelfUrl"] + "/Paid";
        });
  • looking at docs, for predefined gateways, there is no need to configure PaymentOptions
  • in appsettings.json add
{
  "App": {...},
  "Redis": {...},
  "ConnectionStrings": {...},
  "AuthServer": {...},
  "Payment": {
    "Stripe": {
      "PublishableKey": "publishable_key",
      "SecretKey": "secret_key",
      "PaymentMethodTypes": [ "card" ]
    }
  }
}
  • start a payment from razor main index model
public async Task<IActionResult> OnGetAsync()
    {
        var paymentRequest = await paymentRequestAppService.CreateAsync(new PaymentRequestCreateDto()
        {
            Currency = "USD",
            Products = new List<PaymentRequestProductCreateDto>()
            {
                new PaymentRequestProductCreateDto
                {
                    Code = "Product_code",
                    Name = "Product name",
                    Count =1,
                    UnitPrice = 20,
                    TotalPrice = 20
                }
            }
        });

        return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);
    }
  • login with admin and run locally

Now the effects:

  • /Payment/GatewaySelection returns code 400. If I look at logs I can see that:
Request starting HTTP/2 GET https://localhost:44374/Payment/GatewaySelection?paymentRequestId=a246857e-af5f-012d-0eee-3a09ec82cd86 - -
[11:41:08 DBG] Added 0 entity changes to the current audit log
[11:41:08 DBG] Added 0 entity changes to the current audit log
[11:41:08 DBG] Added 0 entity changes to the current audit log
[11:41:08 INF] Executing endpoint '/Payment/GatewaySelection'
[11:41:08 INF] Route matched with {page = "/Payment/GatewaySelection", action = "", controller = "", area = ""}. Executing page /Payment/GatewaySelection
[11:41:08 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
[11:41:08 INF] Executing handler method Volo.Payment.Pages.Payment.GatewaySelectionModel.OnGet - ModelState is Valid
[11:41:08 INF] Executed handler method OnGet, returned result Microsoft.AspNetCore.Mvc.BadRequestResult.
[11:41:08 INF] Executing StatusCodeResult, setting HTTP status code 400
[11:41:08 INF] Executed page /Payment/GatewaySelection in 2.4219ms
[11:41:08 INF] Executed endpoint '/Payment/GatewaySelection'
[11:41:08 INF] Request finished HTTP/2 GET https://localhost:44374/Payment/GatewaySelection?paymentRequestId=a246857e-af5f-012d-0eee-3a09ec82cd86 - - - 400 0 - 47.9921ms
  • going to /Payment/Requests I can see the payment request created with Wait state

I've tried a bunch of configs and all that I could see in docs and around support answered questions. Basically the gateways pages are not available. Seems like it's missing some configuration? What could cause that BadRequestResult in GatewaySelectionModel.OnGet?

Please advise. Thank you.

Thank you for the links. The thing is, I need the app to work. Curiously enough, on an android 10 device it doesn't work also. Is it possible to deploy abp to azure with openiddict without the need to have self signed certificates? I believe all this is because of these certificates. Because as it is, basically the MAUI app is useless...\

I have noticed something in the output:

java.lang.IllegalStateException: Handshake has already been started at com.android.org.conscrypt.OenSSLEngineImpl.beginHandshakeInternal(OpenSSLEndingeImpl.hava:335)

Later edit: From preliminary testing, it seems that upgrading Visual Studio to the new version, which probably updated also .net 7 fixes the problem. Will do further testing in the following days.

  • ABP Framework version: v6
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

I'll do my best to explain the situation:

  • apb app using openiddict
  • the app has been published on azure
  • in order to publis the app, two certificates have been generated, one for encryption and one for signing. These certificates were added on PreConfigure<OpenIddictServerBuilder>. These certificates are added on azure
  • have the maui app, migrated to .net 7, connect in two ways: by doing a normal httpClient.PostAsync and by calling an injected app service

Result:

  • when running the android app on devices with android 10,11,13 -> everything works as expected
  • where running the android app on emulators with android 7,8 -> it doesn't work. Here are the exceptions:

The SSL connection could not be established, see inner exception

digging deeper into the inner exception I get:

System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception

digging deeper into the inner exception again I get:

Interiop+AndroidCrypto+SslException: Exception of type Interiop+AndroidCrypto+SslException was thrown and this happens at System.Net.Security.SslStream<ForceAuthenticationAsync>

Why does it work on some android versions and not on others? Does it have something to do with the genereated self signed certificates? How can I make it work? Thank you for your time

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

Here is my scenario:

  • app has a public web site generated by abp suite, roles and permissions are seeded
  • a new user goes to public web site
  • user goes to log in. Since it is a new user, it goes through registration
  • after registration when user is redirected to public web site index page. I check if the user has any role (CurrentUser.Roles.Length). Since the user is new, there are no roles so I redirect to a new page from public where he picks a role. After the user picks a role, he is being added to the role by using IdentityUserManager.AddToRoleAsync(). Everything is working without error and the role grant is visible in the database.

Now the problem:

  • the user has registed and is logged in, it has been added to a role, but it seems that the current token and claims do not know about the role. Calling an app service that requires permission will throw authorization fail error. CurrentUser.Roles is empty. Manually logging off and the log in with the user makes it work, CurrentUser.Roles is filled and the authorized error goes away.

What I have tried:

  • after adding the user to the role, I call for a page on Web (so not on public) which has access to SignInManager<IdentityUser> which does a RefreshSignInAsync(). After doing this call and refreshing the page, the CurrentUser.Roles gets filled. This works on Web, however the token on the Public web remains the same.

Questions:

  • what do I need to do in order to have the user be able to access all the permissions granted by the role it has? How to refresh the public web site token?
  • is there a better recommended way to achieve programmatically role assignment without the user need to relogin?

Thank you for your time.

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