grant_type
as a form parameter.<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 name="GenerateAccessTokenClient">
<!-- This policy generates an OAuth 2.0 access token using the client_credentials grant type -->
<Operation>GenerateAccessToken</Operation>
<!-- This is in millseconds, so expire in an hour -->
<ExpiresIn>3600000</ExpiresIn>
<SupportedGrantTypes>
<!-- This part is very important: most real OAuth 2.0 apps will want to use other
grant types. In this case it is important to NOT include the "client_credentials"
type because it allows a client to get access to a token with no user authentication -->
<GrantType>client_credentials</GrantType>
</SupportedGrantTypes>
<GrantType>request.formparam.grant_type</GrantType> <!--changed this part -->
<GenerateResponse/>
</OAuthV2>
AssignMessage
to send numeric values as Json Numbers/Integers. This is required as by default apigee token response sends all numeric values as JSON Strings. This causes the Kyma Oauth client to fail to parse. See this apigee community thread.<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="expires_in_to_int">
<DisplayName>expires_in_to_int</DisplayName>
<Properties/>
<Set>
<Payload contentType="application/json">
{
"refresh_token_expires_in" : {oauthv2accesstoken.GenerateAccessTokenClient.expires_in},
"api_product_list" : "{oauthv2accesstoken.GenerateAccessTokenClient.api_product_list}",
"organization_name" : "{oauthv2accesstoken.GenerateAccessTokenClient.organization_name}",
"issued_at": {oauthv2accesstoken.GenerateAccessTokenClient.issued_at},
"client_id" : "{oauthv2accesstoken.GenerateAccessTokenClient.client_id}",
"access_token" : "{oauthv2accesstoken.GenerateAccessTokenClient.access_token}",
"application_name" : "{oauthv2accesstoken.GenerateAccessTokenClient.application_name}",
"scope" : "{oauthv2accesstoken.GenerateAccessTokenClient.scope}",
"expires_in" : {oauthv2accesstoken.GenerateAccessTokenClient.expires_in},
"refresh_count" : {oauthv2accesstoken.GenerateAccessTokenClient.refresh_count},
"status" : "{oauthv2accesstoken.GenerateAccessTokenClient.status}"
}
</Payload>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="true" transport="http" type="response"/>
</AssignMessage>
https://{your environment}.apigee.net/oauth/client_credential/accesstoken
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
17 | |
11 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 | |
5 |