Add ASP.NET Identity (User Management) to OData via Web API 2 RRS feed

  • General discussion

  • I have an OData project that was created from Web API template (including credentials).

    I have an ApplicationUser:IdentityUser class.

    I have a TournamentContext : IdentityDbContext class.

    I have the default AccountController that comes with the template with [RoutePrefix("api/Account")] attribute.

    In WebApiConfig.cs For the web api template default routing I have

                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new {id = RouteParameter.Optional});

    For the OData support I've added:

    config.Routes.MapODataRoute("odata", "odata", GetModel(),
                new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));


    private static IEdmModel GetModel()
            ODataConventionModelBuilder builder = new ODataConventionModelBuilder();            
            return builder.GetEdmModel();

    Now, I want to expose the account/user management via the OData API. How do I achieve that?


    Janiv Ratson.

    Janiv Ratson. Technology and Development Expert. | BL: | LI: | TW:

    Tuesday, February 4, 2014 9:29 PM

All replies

  • You may want to post the question on since the issue is related to Web API.
    Wednesday, February 5, 2014 5:43 PM
  • Hello and thank you for moving my question to the appropriate forum.

    Would you help me with this topic?



    Janiv Ratson. Technology and Development Expert. | BL: | LI: | TW:

    Wednesday, February 12, 2014 7:28 AM