Hello! I’m hoping that this isn’t a daft question but I’m getting the following error upon a curl POST request:
{
"fault": {
"detail": {
"errorcode": "messaging.adaptors.http.configuration.ApplicationNotFound"
},
"faultstring": "Unable to identify proxy for host: <org>-<env>-sandbox.apigee.net:12872 and url: /aty/oauth/client_credential/accesstoken"
}
}
Now I’m essentially following the oauth guide and hit a road block.
With the OOTB oauth proxy I would have thought that the following cUrl should:
curl -v -X POST "https://<org>-<env>-sandbox.apigee.net/aty/oauth/client_credential/accesstoken" -d 'grant_type=client_credentials' -d "client_id=${consumer_key}&client_secret=${consumer_secret}"
NOTE: I have stripped the org and environment out but these have been checked and are correct.
It seems that this has been asked before however short of undeploying and redeploying I couldn’t see any other solutions.
To check that this wasn’t due to the HTTPS protocol for some reason I modified HTTPProxyConnection to the following:
Note: adding default none HTTPS virutual hosts
<HTTPProxyConnection>
<BasePath>/aty/oauth/client_credential</BasePath>
<Properties/>
<VirtualHost>default</VirtualHost>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
But I still have the same issue, so reverted that.
This is the Proxy Endpoints configuration:
Note: that I have modified the endpoint slightly.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Description/>
<FaultRules/>
<Flows>
<Flow name="RefreshAccessToken">
<Description/>
<Request>
<Step>
<FaultRules/>
<Name>RefreshAccessToken</Name>
</Step>
</Request>
<Response/>
<Condition>(proxy.pathsuffix MatchesPath "/refresh_accesstoken") and (request.verb = "POST")</Condition>
</Flow>
<Flow name="AccessTokenClientCredential">
<Description/>
<Request>
<Step>
<FaultRules/>
<Name>GenerateAccessTokenClient</Name>
</Step>
</Request>
<Response/>
<Condition>(proxy.pathsuffix MatchesPath "/accesstoken") and (request.verb = "POST")</Condition>
</Flow>
</Flows>
<HTTPProxyConnection>
<BasePath>/aty/oauth/client_credential</BasePath>
<Properties/>
<!--<VirtualHost>default</VirtualHost>-->
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="NoRoute"/>
</ProxyEndpoint>
This is the GenerateAccessTokenClient:
Unmodified
<?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.queryparam.grant_type</GrantType>
<GenerateResponse/>
</OAuthV2>
Any advice would be grand!
