0

Here the article about how to generate user access token: http://charithaka.blogspot.ru/2013/07/oauth-20-grant-types-with-wso2-api_16.html

Now I have application token, user token generated like in this article and trying to invoke API method , configured in Api Manager UI to be accessed with user AND app authorization.

App authorization token goes in request as: header: Authorization Bearer But absolutely no info on where goes .. Tried in query string. Tried alone with api methods configured for access with only user authorization. Getting 401 error response from api manager..

https://lisp.cc/apimanager.jpg - screenshot where I found no docs how to grant access to api restricted by case 1 or 2 (marked red lines)

Any suggestions?

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105

1 Answers1

0

I believe you have successfully published your API, and generated application accesstoken and user access token. You can use those tokens to send request to relevant APIs. For example, if you have an application token generated and if you want to access your API; you can use following curl command to execute your API;

curl -H "Authorization :Bearer APPLICATION_TOKEN" http://localhost:8280/testAPI/1.0.0

How you are invoking your API? what is your curl command? You can check the documentation for a sample

Ratha
  • 9,434
  • 17
  • 85
  • 163
  • Yes, I've got Application access token and can successfully invoke API's opened for authorized app. But I'am also got "user access token" through integrated in APIManager oauth2 mechanism(redirect to login password page, grant button ..etc) and want to use this user access token AND application access token to invoke API granted for "User and Application auth" in APIManager. And it didn't work. Also with "user access token" I can't access API granted for "User authorization" only. Like in Charitha Kankanamge's blog I've got user access token but can't imagine how to apply it to access api. – Sergey Krasnikov Jan 25 '14 at 15:59
  • How did you get usertoken? Try get like this http://docs.wso2.org/display/AM160/Token+API#TokenAPI-GeneratingaccesstokenswithusercredentialspasswordgranttypeGenerating and check invoking APIs. – Ratha Jan 27 '14 at 07:46
  • I only want to know how to invoke api while I'am already have app and user tokens in case of: http://lisp.cc/apimanager.jpg 1 and 2. App token goes to Bearer auth header and user token goes to .. where? – Sergey Krasnikov Jan 27 '14 at 11:39
  • https://lisp.cc/apimanager.jpg working link to api manager publisher screenshot if http link does not work. – Sergey Krasnikov Jan 27 '14 at 11:47