Hi everybody.
I have the following problem with apigee
I made
And describe it in flow
But when I try to get access to my backend api, I get the following problem
Why this variable is empty?? Password issue is the same.
P.S. I try to map credentials on my Environment variables
so what am I doing wrong?
Solved! Go to Solution.
What is the value you are expecting for those variables that are used as ref within the policy? From your screenshot, I see the variables are not being set. You might want to use the KVM key directly as parameter. See below
In your getUsername policy - change the config to
<Get assignTo="credentials.username" index="1"> <Key> <Parameter>username</Parameter> </Key> </Get>
Hi Oleksandr Skoryi,
You can find discussion on similar issue here.
What is the value you are expecting for those variables that are used as ref within the policy? From your screenshot, I see the variables are not being set. You might want to use the KVM key directly as parameter. See below
In your getUsername policy - change the config to
<Get assignTo="credentials.username" index="1"> <Key> <Parameter>username</Parameter> </Key> </Get>
Adding on - instead of 2 KVM get policies, you can have one policy called "getUserCredentials" with two Get operations
<Get assignTo="credentials.username" index="1"> <Key> <Parameter>username</Parameter> </Key> </Get> <Get assignTo="credentials.password" index="1"> <Key> <Parameter>password</Parameter> </Key> </Get>
I want to get values from key-value pair from environment configuration variables
I did like you said. But as for as you can see i get 500. And values credentials.password and credentials username are empty.
Here is my KeyValue file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <KeyValueMapOperations name="GetCredentials" mapIdentifier="Credentials" continueOnError="false"> <Get assignTo="credentials.username" index="1"> <Key> <Parameter>user</Parameter> </Key> </Get> <Get assignTo="credentials.password" index="1"> <Key> <Parameter>1234</Parameter> </Key> </Get> </KeyValueMapOperations>
Hi
Looks like you are passing the actual value in your policy. You should be using the key - in your case "username" and "password"
Just replace your policy with the one below and let me know if it works:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <KeyValueMapOperations name="GetCredentials" mapIdentifier="Credentials" continueOnError="false"> <Get assignTo="credentials.username" index="1"> <Key> <Parameter>username</Parameter> </Key> </Get> <Get assignTo="credentials.password" index="1"> <Key> <Parameter>password</Parameter> </Key> </Get> </KeyValueMapOperations>
The values are fetched from KVM and stored in the variables you created - in this case they are "credentials.username" and "credentials.password"
At last, everything works. Thanks a lot!
Glad it worked !! Please continue posting questions, ideas, etc on community..
User | Count |
---|---|
6 | |
2 | |
1 | |
1 | |
1 |