AngieJs SPA에서 swagger-js/swagger-client (https://github.com/swagger-api/swagger-js)를 사용하여 TryItOut Executor를 사용하여 nodeJS 서버에 REST 요청을 보냅니다.Swagger-js로 브라우저 쿠키 활성화
인증에 PassportJS를 사용하고 있습니다. 내가 true로 설정 withCredentials 속성을 사용하여 각도의 $ HTTP 서비스를 사용하는 경우 :
$http({
method: 'GET',
withCredentials: true,
url: 'http://someUrl/someRestPath/' })
을, 모든 확인을 작동 - 브라우저 쿠키가 제대로 설정되어, 모든 추가 요청이 성공적으로 인증됩니다.
swagger-js Executor로 전환하면 쿠키가 설정되지 않아 제대로 인증되지 않습니다. 나는 다음을 시도했다 :
var swaggerClient = new SwaggerClient(specUrl)
.then(function (swaggerClient) {
swaggerClient.http.withCredentials = true; // this activates CORS, if necessary
설명서에 제안되었지만 이는 아무런 효과가 없다. 여권으로 인증 할 때 자격 증명을 받지만 쿠키가 설정되지 않아 더 이상의 요청이 승인되지 않습니다.
Left: cookies not being sent; Right: cookies being set
어떻게 자신감-JS를 사용하여이 동작을 사용하려면?