Please provide a process for configuring Client-Credentials grant type in apigee by usign oauth

I am trying to configure Client-Credentials Grant type in apigee by using OAUTH can any please provide the information of required policies.

Solved Solved
0 7 416
1 ACCEPTED SOLUTION

@Rajesh Nimmada , You got the access token from client credentials generate API token call, Once you have the access token , Call the actual API resources using Authorization header ,

Authorization : Bearer {ACCESSTOKEN}

Make sure your API resource does verify access token & same API resource / proxy has been added to the product that you have used to generate token.

View solution in original post

7 REPLIES 7

@Rajesh Nimmada , Have you tried creating the API Proxy with oAuth generate token ? Did you create a product & developer app to get keys ? What have you tried ? Where are you stuck ? Did you get a chance to refer our docs ?

ya I created application and got client-id and secret and also I got following response in jason format

{
"issued_at": "1478798385370",
"application_name": "3c1c7400-bfd4-48c9-9f93-cda2cbe9055b",
"scope": "",
"status": "approved",
"api_product_list": "[sampleoauth-Product]",
"expires_in": "3599",
"developer.email": "rnimmada@miraclesoft.com",
"token_type": "BearerToken",
"client_id": "vdJLUz6XydizpK5Ms5EQFOuo90IKRpri",
"access_token": "m0X2NR9RkY5tSr6PAzzeCutdNuP0",
"organization_name": "rajeshnimmada",
"refresh_token_expires_in": "0",
"refresh_count": "0"
}

tell me the next process

How can I test this in SOAP-ui

@Rajesh Nimmada , You got the access token from client credentials generate API token call, Once you have the access token , Call the actual API resources using Authorization header ,

Authorization : Bearer {ACCESSTOKEN}

Make sure your API resource does verify access token & same API resource / proxy has been added to the product that you have used to generate token.

Ya I did the same thing by adding Bearer in authorization headers but it asking valid client identifier.

<data contentType="null" contentLength="74">
<![CDATA[{"ErrorCode" : "invalid_client", "Error" :"Client identifier is required"}]]>
</data>

I specified the policies below

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="GenerateAcessToken">
<!--<DisplayName>Verify OAuth v2.0 Access Token</DisplayName>-->
<Operation>GenerateAccessToken</Operation>
<ExpiresIn>3600000</ExpiresIn>
<SupportedGrantTypes>
<GrantType>client_credentials</GrantType>
</SupportedGrantTypes>
<GrantType>request.queryparam.grant_type</GrantType>
<GenerateResponse/>
</OAuthV2>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="VerifyAccessToken">
<!--<DisplayName>OAuth v2.0-1</DisplayName>-->
<Properties/>
<Attributes/>
<ExternalAuthorization>false</ExternalAuthorization>
<Operation>VerifyAccessToken</Operation>
<AccessTokenPrefix>Bearer</AccessTokenPrefix>
<!--<AccessToken>request.header.access_token</AccessToken>-->
<SupportedGrantTypes/>
<GenerateResponse enabled="true"/>
<Tokens/>
</OAuthV2>

Thank you very much for your co-operation I got successful response.