Forum Discussion

janos_pesti's avatar
janos_pesti
Novice I
3 years ago

good morning, codyhosterman I used the PureStorage.Pure1

good morning, codyhosterman I used the PureStorage.Pure1 module to get load metrics from Pure1, which worked fine yesterday. But when I run the same script with same cert, etc, I get the message JWT expired. How can I make this authentication process work so if I run it once every hour, I can get authenticated properly? ```$mypwd = "xxxx" $CertObj = Get-PfxCertificate -FilePath C:\Stash\PowerShell-Projects\Pure1\mypfx.pfx -Password $mypwd $pure1_appid = "pure1OSWa2R7FOwejvETD" $PureOneConn = New-PureOneRestConnection -certificate $CertObj -pureAppID $pure1_appid``` reply: `Exception: The Pure1 Organization with ID 1001 is already connected.` ```$PureOneArrays = Get-PureOneArray -arrayProduct FlashArray Invoke-RestMethod: {"message":"JWT is expired"}```
  • So there are a couple options. *First option is* 1) By default, New-PureOneConnection creates a very short lived JWT in the background and spawns a new session that lasts 10 hours. You can create your own JWT with a arbitrarily long expiration and pass it in instead