hai All, Sumedha,

                           What am I doing is that I am calling the access
token generation  REST endpoint from Greg. Here the API manager is running
as an another instance, When a user clicks a menu item from Greg management
console, it will call the Token generation REST endpoint and generate the
key and displayed at the Greg.


I am unclear whether am I calling the right endpoint or not?

I am running the API manager with default configuration.

Thanks!
Ragu




On Mon, May 20, 2013 at 1:09 AM, Dinusha Senanayaka <dinu...@wso2.com>wrote:

>
>
> On Mon, May 20, 2013 at 12:47 AM, Sriragu Arudsothy <srir...@wso2.com>wrote:
>
>> Hai all,
>>
>>           I have used the following REST call to generate the access
>> token from API manager.
>>
>>
>> http://127.0.0.1:9763/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag?action=generateApplicationKey&keytype=Bearer&callbackUrl=&authorizedDomains=All&application=Registry
>>
>> The response contains the consumer key/ secret and access token ..etc.
>> When I used the generated access token to access the registry resources
>> using Registry REST API it  shows the following error at the back end.
>>
>> org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException:
>> Error while accessing backend services for API key validation
>> at
>> org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftAPIDataStore.getAPIKeyData(ThriftAPIDataStore.java:79)
>>  at
>> org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.doGetKeyValidationInfo(APIKeyValidator.java:126)
>> at
>> org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.getKeyValidationInfo(APIKeyValidator.java:110)
>>  at
>> org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.java:116)
>> at
>> org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHandler.java:88)
>>  at org.apache.synapse.rest.API.process(API.java:252)
>> at
>> org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
>>  at
>> org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
>> at
>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:191)
>>  at
>> org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>  at
>> org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:353)
>> at
>> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:196)
>>  at
>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>  at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> at java.lang.Thread.run(Thread.java:662)
>>
>>
>> Caused by:
>> org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException:
>> Unauthorized client domain :null. Only "All" domains are authorized to
>> access the API.
>>  at
>> org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftKeyValidatorClient.getAPIKeyData(ThriftKeyValidatorClient.java:87)
>> at
>> org.wso2.carbon.apimgt.gateway.handlers.security.thrift.ThriftAPIDataStore.getAPIKeyData(ThriftAPIDataStore.java:77)
>>  ... 16 more
>>
>> but I have specified the authorizedDomain during the call request.
>>
> How did you define the authorized domain in your request ? If you use the
>> default configuration in apimanager.xml, domain should pass along with http
>> header 'referer' (eg: -H "referer: wso2.com") .
>>
>
> Regards,
> Dinusha.
>
>
>>
>>
> Please API team give me a response as soon as possible.
>>
>> Thanks!
>> Ragu
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Dinusha Dilrukshi
> Software Engineer
> WSO2 Inc.: http://wso2.com/
> Mobile: +94725255071
> Blog: http://dinushasblog.blogspot.com/
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to