Help with New-UDAuthenticationResult

Hello,
I’m using New-UDAuthenticationResult inside a New-UDAuthenticationMethod to create Json web token for user connecting to my api… is there a way to control the expiration date for the token ? by default it’s 25 minutes…

And i’m a bit confused between New-UDAuthenticationResult and Grant-UDJsonWebToken

I’m running 2.6.2 and New-UDAuthenticationResult has a -Token parameter … so i thought i could create a token with $Token = Grant-UDJsonWebToken (since you can specify an expiration date… ) and serve it like that New-UDAuthenticationResult -Token $Token… but it’s not working ! and this -Token parameter seems to not be documented ! maybe i’m wrong but i found nothing !

So passing a token generated by Grant-UDJsonWebToken works … but if i specify a expiration date liek this:

$date = (get-date).AddMinutes(10)
$token = Grant-UDJsonWebToken -Identity $Credential.UserName -Role $Role -Expiry $date
New-UDAuthenticationResult -Success -UserName $Credential.UserName -Role $role -Token $token

The generated token still has a expiration time of 25 minutes ( tested on jwt.io )

am i doing something wrong ??

This looks like a bug. Can you please open a GitHub issue for it?

done ! :slight_smile:

1 Like