I have a script file that makes a call to JSON API, and I need to send the current login username as part of the call. I tried the following :-
$(documen
@User.Identity.Name
You can directly access user identity in script section by prefixing @
@User.FindFirst(ClaimTypes.NameIdentifier).Value
also a good option.