Cesium: send sesion ID/cookie in WMS request

المشرف العام

Administrator
طاقم الإدارة
I am trying to add a layer from geoserver to my Cesium globe.I do a post request to get a cookie so that I can authenticate the request and access the content in my geoserver. But am having trouble pass that authentication onto the Cesium WMS ImageryProvider request. What are the options for sending session IDs or authentication when requesting a WMS layer?

thank you

$.ajax({url: SignOnURL,beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "Basic EncodedCredentials"); },type: "post",success: function (){alert( 'authenticated' ); var viewer = new Cesium.Viewer('cesiumContainer');var imageryLayers = viewer.imageryLayers;imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({url : 'urlToGeoServer',layers : 'layerName',})); },xhrFields: { withCredentials: true }, crossDomain: true });

أكثر...
 
أعلى