identity manager

251
2
01-12-2024 01:31 PM
EliyahoLevi
New Contributor III

Hi all, I'm trying to extends to token expiration time when using the generateToken method of the IdentityManager , but could not seem to succeed. anyone have some thoughts about this?  

0 Kudos
2 Replies
ViktorSafar
Occasional Contributor II

Please show your code and describe more precisely what you need/want

0 Kudos
muygunol
New Contributor II

hello.
i am using POST method to generate token.
You can increase expiration value while generating token.

var tokenvalue = $.ajax({
type: "POST",
url: generatetoken, //address of arcgis server or portal
data: {
username: username,
password: password,
client: "referer&requestip",
referer: locationaddress,
expiration: '60',
f: "json"
},
dataType: "json"
}).done(function (response) {....

 
for IdentityManager you can try this;

const userInfo = { 
username: username, 
password: password, 
client: "referer",
referer: locationaddress,
expiration: 60
};

IdentityManager.generateToken(serverInfo, userInfo).then(function (response){....

 

0 Kudos