Azure App Service Authentication with Google / Facebook - register user on webapi backend RRS feed

  • Question

  • User1784932228 posted

    I have a webapi that is hosted on Azure. I'm trying to use the App Service authentication service for Google / Facebook. I've got it setup with Google and can see the google login page when I try to access this url


    Once I login with google, i see all my google information here:


    However, if i try to access one of the endpoints, i get an unauthorized error. For example, I'm using the Visual Studio WebAPI template project. It has the following endpoint:


    That endpoint above gives me this error:

    <Message>Authorization has been denied for this request.</Message>
    The controller for that endpoint looks like this (again this is a pre-generated code from the Web API template):
    namespace WebApi.Controllers
        public class AccountController : ApiController
            private const string LocalLoginProvider = "Local";
            private ApplicationUserManager _userManager;
            public AccountController()

    I believe there needs to be a registration process done first on the webapi backend. For example, to call the following endpoint:


    Does this registration process need to take place? 

    If so, how should my client do the POST so it gets through the Azure authentication service?

    Thursday, July 14, 2016 12:44 AM

All replies