Basic authorization headers


Is it possible to add basic authorization headers to each request to GeoServer (WMS layers)? And, if yes, how it can be handled?

Thanks in advance!

You need to use a Resource to specify the URL instead of a string. I don’t have a server to test the following, but I think it is the right approach.

var provider = new Cesium.WebMapServiceImageryProvider({

url : new Cesium.Resource({

    url: '',

    headers: {

        'Authorization': 'Basic Base64UsernamePasswordGoesHere'



layers : '0',

proxy: new Cesium.DefaultProxy('/proxy/')




Hi Scott,

Yes, it's works perfect! Thank you very much!