my user name and password is stored in a kvm, i will use a kvm policy to retrieve those 2 variables. however, how do i encode those 2 to base64 so i can use it as header to my target request? I am thinking using KVM and AM message, but i dont know how to encode it to base64 before the AM policy
There is a BasicAuthentication policy that does exactly this.
<BasicAuthentication name="CreateBasicAuthHeader"> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="retrieved-from-kvm.username" /> <Password ref="retrieved-from-kvm.password" /> <AssignTo>request.header.Authorization</AssignTo> </BasicAuthentication>
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |