Create OAuth2 token via groovy
Hi,
I want to authorize a rest service by passing the token via the header.
I know that you can enter all necessary details in "authentication"-tab. (see screenshot)
Is there a way to create a token (with same parameters as mentioned in the screenshot) via groovy script?
(so that I don't have to create a new profile via GUI)
Once token is generated by groovy script, I can store it as property value and link it to the rest service via header parameter.
e.g. groovy script provide "xxxxxxx" as token, which I store in "Token"-parameter (part of "Properties")
In header of rest service request, I can add following parameter: "Authorization" and with value "${Properties#Token}
Can someone help me please with the creation of the groovy script? (to receive the OAuth2 token)
Thanks in advance!