◦ From data source manager, add a new connection
◦ Enter connection name
◦ Enter layer URL you have from the secured links at MnA guardian edition
◦ From the authentication section, create a new authentication profile
◦ Enter profile name
◦ Change authentication type to “OAuth2 authentication”
◦ In the configure tab, change grant flow to “Resource owner”
◦ Enter token URL, for example: “${keycloakurl}/realms/${organizationName}/protocol/openid-connect/token”
◦ Enter client ID
◦ Enter client secret
◦ Provide credentials “username & password”
◦ Enter scope as “openid”
◦ In the advanced section below, change access method to “Header”
◦ Now save and connect, you should be able to list all your permitted layers
◦ From the catalog, navigate to GIS servers
◦ Add a new connection (WMS server)
◦ In the URL, add the URL you have from the secured links at MnA guardian edition, the URL should be constructed as the follow: “http://guardianURL/wmsCapability/$Error! Hyperlink reference not valid.
◦ Now you should be able to list all your permitted layers
Create a new Image object following the below example:
let myImage = new Image(
{
title: layerTitle,
source: new ImageWMS(
{
url: layerURL,
params: {
[LAYERS],
VERSION: '1.1.1'
},
imageLoadFunction: function customLoader(tile, src) {
axios.get(src, {
headers: {
Authorization: 'Bearer ' + token,
PentaOrgID: tokenInfo.user.split('@')[1],
PentaSelectedLocale: ${locale},
PentaUserRole: ${role}
},
responseType: 'arraybuffer'
})
.then(({ data, _ }) => {
const base64 = btoa(
new Uint8Array(data).reduce(
(d, byte) => d + String.fromCharCode(byte),
'',
),
);
tile.getImage().src = 'data:image/png;base64,' + base64;
}).catch(e => {
tile.getImage().dispatchEvent(new Event('error'));
})
}
}
)
}