각도 2를 사용하고 있습니다. (angular-cli : 1.0.0-beta.11-webpack.9-4를 통해 사용하는 것은 최신 버전이 아닙니다) withCredentials를 다음과 같이 설정해야합니다. 모든 http 요청에 대해 true입니다. ({withCredentials : TRUE} 'http://my.domain.com/request') 나는 1 개각도 2 - 모든 http 요청에 withCredentials = true를 추가하십시오.
http.get를 사용하여 요청을 설정하려고
모든 것이 그러나 나는 다음과 같이하지만 부트 스트랩 뭔가를 사용하는 것을 시도하고 잘 작동 그것은 더 이상 필요한 경우 내가 아는하지 않는 성공
import './polyfills.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/';
import {Http, Headers, BaseRequestOptions, RequestOptions, BrowserXhr} from '@angular/http';
if (environment.production) {
enableProdMode();
}
export class MyRequestOptions extends BaseRequestOptions {
constructor() {
super();
this.headers.append('withCredentials','true');
}
}
platformBrowserDynamic().bootstrapModule(AppModule,
[{ provide: RequestOptions, useClass: MyRequestOptions}]
);
안녕 (내 경우에는, 이것은 그 CORS + NTLMAuthentication와 함께 일입니다) , 나는 똑같은 문제에 직면하고있다. 어떻게하는지 알아 냈는가? – Gustavo
아니요 아직 해결하지 못했습니다 ... – Jay