Hello All,
I am new to apigee, please pardon my ignorance My target endpoint requires username/password, so I wanted to hardcode the credentials, for this I created first a "KVM" .. Then I created the "Basic Authentication policy.. But when I use it I get following error
{ fault: { faultstring: "Unresolved variable : CRAuthMap.cr.username", detail: { errorcode: "steps.basicauthentication.UnresolvedVariable" } } }
Following is my KVM
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="CreateCRAuthMap"> <DisplayName>CreateCRAuthMap</DisplayName> <Properties/> <ExpiryTimeInSecs>86400</ExpiryTimeInSecs> <Put> <Key> <Parameter>cr_username</Parameter> </Key> <Value>content-repo-reader</Value> </Put> <Put> <Key> <Parameter>cr_password</Parameter> </Key> <Value>XXXXXXX</Value> </Put> <Scope>environment</Scope> </KeyValueMapOperations>
Following is my auth policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication async="false" continueOnError="false" enabled="true" name="Basic-Authentication-1"> <DisplayName>CR Authentication</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="CRAuthMap.cr.username"/> <Password ref="CRAuthMap.cr.password"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> <Source>request.header.Authorization</Source> </BasicAuthentication>
Solved! Go to Solution.
Welcome to the community !!
There was a similar post - please refer to this answer and let us know if you are still stuck