0

не передаются куки для web api, для mvc все работает.

FormsAuthentication.SetAuthCookie(model.Email, true);

запрос с клиента передается через jquery ajax

        var serviceId = $('#Id').val();

        $.ajax({
            method: 'GET',
            url: '@Url.RouteUrl("DefaultApi", new { httproute = "", controller = "Number" })' + '?serviceId=' + serviceId
        })

1 ответ 1

0
    public static void Register(HttpConfiguration config)
    {
        // Web API configuration and services
        // Configure Web API to use only bearer token authentication.
        config.SuppressDefaultHostAuthentication();
        config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));

вот из-за этого не работало

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.