Open Closed

External provider sync api #2758


User avatar
0
shobhit created
  • ABP Framework version: v4.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi Team, We have our custom mobile app. In mobile app we have integrated google and other provider for user sign-up. We would like to store mobile user sign-up information with web application so that same user can login seamlessly in mobile and web application. Please share the ABP api to use or code reference.


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

    We would like to store mobile user sign-up information with web application

    Username password info or the external login info?

  • User Avatar
    0
    shobhit created

    External login info like we store in web application for any external provider like "google", "twitter".

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    These are handled by ASP NET Core Identity by default. The data is stored in the UserLogins table.

  • User Avatar
    0
    shobhit created

    Hello @maliming, Thanks but i am confused.

    1. if external user registeration taken care by ASP NET Core Identity then how i have to register Exernal user.
    2. Currently to register local user we are using "/api/account/register" api endpoint. we will give a try with same api end point for external provider user registeration
    3. how ASP NET Core identity will determine the External provider like "Google"?
    4. when we login to any external provider we gets access token and id token as response, do we have to use them?
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This method of Account module will handle the external login.

    https://github.com/abpframework/abp/blob/dev/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L176-L266

    It will get the email of the external user and then go to register or create a new user. There is a similar code in account pro.

  • User Avatar
    0
    shobhit created

    Hello @maliming, Thanks. i have refered the "Register" code and now can register the user. Now my question is how i can get the auth token for external user login i.e. google login user. Like steps are:

    1. user click on google login button
    2. user provide google credentials
    3. app receive google auth token
    4. Assume user is registered in idetnity server
    5. now how to use this auth token to get the identity server auth token so that api can be consumed in mobile app
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    See https://support.abp.io/QA/Questions/2604/Social-Logins-with-SaveTokens--true-not-saving-tokens#answer-b2f914ae-a820-c983-4573-3a021d98fec3

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15