Open Closed

Access the login provider of the current user #3879


User avatar
0
alin.andersen created

Hey,

I need get the name of the external login provider the current user is linked to.

I found the table AbpUserLogins:

It contains all the information I need. I will need to check if the user came from a specific login provider and then do some logic.

How can I access this data? Is there a service? I found IIdentityExternalLoginAppService, but it does not have any data.

Thanks!

  • ABP Framework version: v6.0.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC)

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can use UserManager<Volo.Abp.Identity.IdentityUser>

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.usermanager-1.getloginsasync?view=aspnetcore-6.0

  • User Avatar
    0
    alin.andersen created

    Yes thank you! The login provider of the user can be found here: IdentityUser -> Logins -> LoginProvider

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11