locked
register facebook and google users using web api RRS feed

Answers

  • User-474980206 posted

    if you follow the oauth logic for the web site, your site redirects to facebook passing an appid. the user logins in to facebook, and facebook redirect back to you site with a token. your site then calls back to facebook with this token to get the user id. your site the matches / creates a local account. your site then create a new cookie token with this account. 

    your mobile app should call a login api on your site just passing the facebook/google token. your site shoudl call facebook/google to get the user id. then return a new access/bearer token to be used with subsequent calls.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 8, 2018 3:07 PM

All replies

  • User475983607 posted

    The design does not make logical sense.  If the web app authenticates with Google or Facebook how will the Web API which token to expect?  You need to build a central IDP service along with the Web API.  Look into IdentityServer4 which will become part of the VS templates or the follow the link to roll your own; https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server

     I recommend that you speak with your team to clarify the requirements.

    Thursday, November 8, 2018 11:43 AM
  • User-474980206 posted

    if you follow the oauth logic for the web site, your site redirects to facebook passing an appid. the user logins in to facebook, and facebook redirect back to you site with a token. your site then calls back to facebook with this token to get the user id. your site the matches / creates a local account. your site then create a new cookie token with this account. 

    your mobile app should call a login api on your site just passing the facebook/google token. your site shoudl call facebook/google to get the user id. then return a new access/bearer token to be used with subsequent calls.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 8, 2018 3:07 PM