How to generate your token?
You can generate a valid token to be used in MnA Guardian edition using one of the below methods depending on your preference:
· Using PostMan:
◦ Request type: POST
◦ URL: ${keycloakurl}/realms/${realmName}/protocol/openid-connect/token
◦ Headers:
▪ Content-Type: application/x-www-form-urlencoded
◦ Body as JSON:
▪ client_id: ${client_id}
▪ client_secret: ${client_secret}
▪ grant_type: password
▪ scope: openid
▪ username: ${username}
▪ password: ${password}
· Using JavaScript axios.get:
let queryParam = qs.stringify({
'client_id': client_id,
'grant_type': 'password',
'client_secret': client_secret,
'scope': 'openid',
'username': req.body.username,
'password': req.body.password
});
let config = {
method: 'post',
url: `${keycloakurl}/realms/${req.body.realm}/protocol/openid-connect/token`,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: queryParam
};
axios(config)
.then(response => console.log(response))
Related Articles
How to generate your token?
You can generate a valid token to be used in MnA Guardian edition using one of the below methods depending on your preference: · Using PostMan: ◦ Request type: POST ◦ URL: ${keycloakurl}/realms/${realmName}/protocol/openid-connect/token ◦ Headers: ▪ ...
Refresh the access token
Access tokens have limited lifetimes. If your application needs access to a Penta-b’s API beyond the lifetime of a single access token, it can obtain a refresh token. A refresh token allows your application to obtain new access tokens
Obtain an access token
Before your application can access private data using Penta-b API, it must obtain an access token that grants access to that API. A single access token can grant varying degrees of access to multiple APIs. There are several ways to make a token ...
Send the access token to an API
After the application obtains an access token, it should send the token to a Penta-b’s API in an HTTP Authorization request header. The following headers should be added to each request: PentaUserRole: the selected user’s role PentaOrgID: the ...
How to access /use a secured layer using my token?
You can access any secured layer using your token depending on your preference using one of the below methods: · QGIS ◦ From data source manager, add a new connection ◦ Enter connection name ◦ Enter layer URL you have from the secured links at MnA ...