KVM authorization issue..

sidd-harth
Participant V

I have created a new application in baas, which cannot be accessed without the organization api credentials(client_id & client secret).

So I created a KVM in api proxy with map_name=baasauthentication using this link

http://apigee.com/docs/management/apis/post/organizations/org_name/apis/api_name/keyvaluemaps


<KeyValueMap name="baasauthentication">
 <Entry name="client_id">b3U67927NL2KEeSNpqlhKF3hyw</Entry>
 <Entry name="client_secret">b3U6rS9D6GesrJwptLGwhiehlfzGris</Entry>
</KeyValueMap>

In the proxy I have an KVM policy,

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="Key-Value-Map-Operations-1">
    <DisplayName>Key Value Map Operations 1</DisplayName>
    <Properties/>
   <ExclusiveCache>false</ExclusiveCache>
   <ExpiryTimeInSecs>-1</ExpiryTimeInSecs>
        <Get assignTo="client_id" index="1">
        <Key>
            <Parameter>baasauthentication.client_id</Parameter>
        </Key>
   </Get>
   <Get assignTo="client_secret" index="1">
        <Key>
            <Parameter>baasauthentication.client_secret</Parameter>
        </Key>
    </Get>
 <Scope>apiproxy</Scope>
</KeyValueMapOperations>

Is my KVM correct?

Next I used Extract and Assign policies to set the authorization but I'm still getting 401 Unauthorized.

Solved Solved
0 6 249
1 ACCEPTED SOLUTION

Not applicable

Try using mapIdentifier="baasauthentication" attribute in KeyValueMapOperations and use client_id/client_secret as parameter .

View solution in original post

6 REPLIES 6

Not applicable

Try using mapIdentifier="baasauthentication" attribute in KeyValueMapOperations and use client_id/client_secret as parameter .

@sriki77 yeah I made the changes and this time I even removed the Extract,Assign policies and added an JS to display the values....it is returning as null.

Any other ideas?

Can you share your proxy zip file...i can try and take a look

sidd-harth
Participant V
KeyValueMaps>
   <KeyValueMap name="baasauthentication">
	<Entry name="client_id">b3U67927NL2KEeSNpqlhKF3hyw</Entry>
	<Entry name="client_name">b3U6rS9D6GesrJwptLGwhiehlfzGris</Entry>
   </KeyValueMap>
</KeyValueMaps> 

This is the keyvaluemap associated with the api proxy(baasauth).

baasauth-rev2-2015-05-11.zip

Not applicable

Your proxy works perfectly for me without any change.

Just ensure

https://api.enterprise.apigee.com/v1/o/<your orgname>/apis/baasauth/keyvaluemaps/baasauthentication

gives the KVM correctly.

Check and let me know.

Yeah it is working. Yesterday I made a small mistake while retrieving the values which I rectified today.

Thank for the help!!