I'm trying to deploy the OAuth2 password grant type sample. But I got "Error: Invalid policy reference...". Can you help me?
* sample
api-platform-samples/sample-proxies/oauth-validate-key-secret/
* code tree
. ├── apiproxy │ ├── policies │ │ └── OA-VerifyAPIKey-and-Secret.xml │ └── proxies │ └── default.xml └── oauth2-password.xml
* oauth2-password.xml
<APIProxy name="oauth2-password"> </APIProxy>
* apiproxy/proxies/default.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ProxyEndpoint name="default"> <Description/> <FaultRules/> <Flows> <Flow name="Token - Password"> <Description/> <Request> <Step> <Name>OA-VerifyAPIKey-and-Secret.xml</Name> </Step> </Request> <Response/> <Condition>(request.verb = "POST") and (proxy.pathsuffix MatchesPath "/token") and (request.formparam.grant_type = "password")</Condition> </Flow> </Flows> <HTTPProxyConnection> <BasePath>/oauth2-password</BasePath> <Properties/> <VirtualHost>secure</VirtualHost> </HTTPProxyConnection> <RouteRule name="NoRoute"/> </ProxyEndpoint>
* apiproxy/policies/OA-VerifyAPIKey-and-Secret.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <OAuthV2 async="false" continueOnError="false" enabled="true" name="OA-VerifyAPIKey-and-Secret"> <DisplayName>OA-VerifyAPIKey and Secret</DisplayName> <ExternalAuthorization>false</ExternalAuthorization> <StoreToken>false</StoreToken> <Operation>GenerateAccessToken</Operation> <!-- This is in millseconds, so expire in an hour --> <ExpiresIn>36000000</ExpiresIn> <SupportedGrantTypes> <GrantType>password</GrantType> </SupportedGrantTypes> <GrantType>request.formparam.grant_type</GrantType> <UserName>request.formparam.username</UserName> <PassWord>request.formparam.password</PassWord> <GenerateResponse enabled="false"/> <GenerateErrorResponse enabled="true"/> <Tokens/> </OAuthV2>
* apigeetool command and the error
$ apigeetool deployproxy -u 'xxx' -p 'xxx' -o 'xxx-eval' -e 'test' -n 'oauth2-password' Error: Invalid policy reference OA-VerifyAPIKey-and-Secret.xml in endpoint default. Context Revision:14;APIProxy:oauth2-password;Organization:xxx-eval
Solved! Go to Solution.
HI @zono
Please remove the ".xml" from the default.xml in the proxies directory
<Step> <Name>OA-VerifyAPIKey-and-Secret</Name> </Step>
HI @zono
Please remove the ".xml" from the default.xml in the proxies directory
<Step> <Name>OA-VerifyAPIKey-and-Secret</Name> </Step>
@Sai Saran Vaidyanathan Oops.. I didn't notice. It worked. Thank you!
@Sai Saran Vaidyanathan I got the same error as he has.
https://community.apigee.com/questions/54975/apigee-edge-messagingruntimeapplicationnotfound-af.html
As you probably know but I would like you to see it.
yes, am following it up and a fix should go out in sometime. lets track this issue in that post
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |