pkumar22
(prasantha Kondakagari)
July 19, 2024, 2:52am
1
we are generating random password and the issue is whenever I do refresh it is generating the new password again and again.
I used below two different transforms but it didn’t worked
{
"name": "PasswordGeneratorWithRandomNumber",
"type": "static",
"attributes": {
"value": "pass${randomNumber}word",
"randomNumber": {
"type": "randomNumeric",
"attributes": {
"length": 4
}
}
},
"requiresPeriodicRefresh": false,
"internal": false
}
{
"name": " PasswordGeneratorWithRandomNumber",
"type": "static",
"attributes": {
"value": "#if($currentValue == 'none')pass${randomNumber}word#{else}$currentValue#end",
"randomNumber": {
"type": "randomNumeric",
"attributes": {
"length": 4
}
},
"currentValue": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "identityAttribute",
"attributes": {
"name": "aaTestAttribute2"
}
},
"none"
],
"ignoreErrors": false
}
}
},
"internal": false
}
Abhinov7
(Abhinov Dhonthula)
July 19, 2024, 3:43am
2
Hi,
You have to add the requiresPeriodicrefresh as part of attributes.
{
"name": "PasswordGeneratorWithRandomNumber",
"type": "static",
"attributes": {
"value": "pass${randomNumber}word",
"randomNumber": {
"type": "randomNumeric",
"attributes": {
"requiresPeriodicRefresh": false,
"length": 4
}
}
},
"internal": false
}
-Abhinov
pkumar22
(prasantha Kondakagari)
July 19, 2024, 4:09am
3
@Abhinov7
I tried given transform and when I refresh page each time it will generating different password.
You can see below screenshot same user each page refresh it is generating new password.
Abhinov7
(Abhinov Dhonthula)
July 19, 2024, 4:13am
4
Hi,
Yes it will refresh every time. Requires periodic refresh will ensure it will not change the value at SailPoint refresh.
can you elaborate on the complete use case?
-Abhinov
neeraj99
(Neeraj Nautiyal)
July 19, 2024, 4:47am
5
Hey @pkumar22 ,
I would suggest you use $oldValue to tackle this situation.
What $oldValue will do is; if the value was already present previously it will give us that.
Consider using this:
{
"name": "PasswordGeneratorWithRandomNumber",
"type": "static",
"attributes": {
"value": "#if(!$priorValue.equalsIgnoreCase('N/A'))$oldValue#{else}pass${randomNumber}word#end",
"randomNumber": {
"type": "randomNumeric",
"attributes": {
"requiresPeriodicRefresh": false,
"length": 4
}
},
"priorValue": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"value": "$oldValue"
},
"type": "static"
},
{
"attributes": {
"value": "N/A"
},
"type": "static"
}
]
}
}
},
"internal": false
}
Hope this helps…
Or this way.
This checks if the identity.attribute has a value, and if not generates one:
{
"name": "PasswordGeneratorWithRandomNumber",
"type": "firstValid",
"attributes": {
"values": [
{
"type": "identityAttribute",
"attributes": {
"name": "extensionAttribute3" #name of your attribute
}
},
{
"type": "static",
"attributes": {
"value": "pass${randomNumber}word",
"randomNumber": {
"type": "randomNumeric",
"attributes": {
"requiresPeriodicRefresh": false,
"length": 4
}
}
}
}
]
}
}
Phil
system
(system)
Closed
September 17, 2024, 7:56am
7
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.