aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

call api/webhooks/registrations with Forms Authentication user? #91

Closed rainmakerho closed 7 years ago

rainmakerho commented 7 years ago

Hi Sirs, Our MVC 5 use Forms Authentication. After login , call api/webhooks/registrations still get 401 response code.

rainmakerho commented 7 years ago

sorry! i fix web api for form auth, it's worked. at web.config , authentication mode use Forms and mark remove FormsAuthentication modules setting

<authentication mode="Forms" />

<modules> <!--<remove name="FormsAuthentication" />--> </modules>

at App_Start/WebApiConfig.cs mark SuppressDefaultHostAuthentication & Filters.Add //config.SuppressDefaultHostAuthentication(); //config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));