Activities of "alin.berce"

  • 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.

Showing 1 to 2 of 2 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13