Select to view content in your preferred language

identity manager

385
2
01-12-2024 01:31 PM
EliyahoLevi
Occasional Contributor

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
Frequent Contributor

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

0 Kudos
muygunol
Occasional Contributor

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