locked
Adding custom Roles to Azure Mobile Services User (Google) RRS feed

  • Question

  • User-1933134441 posted

    I have an .NET Azure Mobile Services project with some controllers I want to secure with the typical Authorize attribute. I can create a Roles table and a User Profiles table and associate the various users authenticated through Google.

    Example of what I want to do:

    [Authorize(Roles = "google")]
    public async Task<HttpResponseMessage> Post(User user){...}

    Like table examples

    Roles
    id | name
    1  | user
    2  | admin
    3  | google
    
    UserProfiles
    id | externalLoginId         | favoriteColor
    1  | Google:<ServiceUser.Id> | blue
    

    Wednesday, June 19, 2019 1:19 PM

Answers