When using the line crossOrigin: 'anonymous',, it returns 401 unauthorized response.

When commenting out that line it works, but I have to be log in to the GeoServer.

Update: I have changed the Request URL to the below format. Now i get a Deprecation message as shown in the yellow border at the bottom, only in chrome. In Firefox it works.

var geoURL = "//username:password@81.4.../geoserver/web/wms";

wmsSource = new ol.source.ImageWMS({
  url: geoURL,
  params: {
    'LAYERS': "web:streets" , 'TILED': true
  serverType: 'geoserver',
  //crossOrigin: 'anonymous',

When accessing that url i get:

[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.