K0NRAD
4/25/2017 - 1:50 PM

Swagger-UI with CORS and Cookies

Swagger-UI with CORS and Cookies

// Add the follow Code Snippet to index.html from swagger-ui v2.x.x

// ...
  window.swaggerUi = new SwaggerUi({
    url: url,
    // --- --- --- ---- 
    useJQuery: true,
    authorizations: {
      makeCredentialed: function() {
        this.xhrFields = {withCredentials: true}; // The important bit, along with useJQuery
        return true;
      }
    },
    // --- --- --- ---- 
// ...