Depend on your grant type you will need to set appropriate parameters. Please follow[1] and check the parameters set in the curl request. I think it would be best to read about the spec and posts on grant types. Resource in [2] will be helpful.
[1] https://docs.wso2.com/display/AM210/Client+Credentials+Grant [2] http://www.bubblecode.net/en/2016/01/22/understanding-oauth2/ On Sun, Jun 10, 2018 at 12:33 PM shibsankar <[email protected]> wrote: > Yes. I see consumer key and consumer secret now when I click generate key > (*screenshot > key-value attached*) > > However, when I call token API with these key and secrets from Postman, I > don't receive any OAuth 2 token. (*screenshot access-token attached*) > > What is going wrong ? > > Regards > Shib > > > > On Sun, Jun 10, 2018 at 11:53 AM, Harsha Kumara <[email protected]> wrote: > >> >> >> On Sun, Jun 10, 2018 at 11:16 AM shibsankar <[email protected]> wrote: >> >>> I checked [1] https://docs.wso2.com/display/AM210/Subscribe+to+an+API >>> , yes, It gives a token for sure when you subscribe API. >>> >>> But is it an Oauth2 token? Or just a normal access token? >>> >> API Manager is compliant with OAuth2 specification. Hence the tokens you >>> obtained will use OAuth2. When you click generate keys button, you will >>> receive a consumer key and secret. >>> *Please see the screenshot attached.* >>> >>> Regards >>> Shib >>> >>> >>> >>> On Sun, Jun 10, 2018 at 9:47 AM, Pubudu Gunatilaka <[email protected]> >>> wrote: >>> >>>> Hi Shib, >>>> >>>> You can refer [1] for getting the token. This explains how to get the >>>> Oauth2 token. >>>> >>>> You do not need to have WSO2 Identity Server for getting an Oauth2 >>>> token. It is coming with API Manager. >>>> >>>> Using the token API [2], you can get a token. >>>> >>>> [1] - https://docs.wso2.com/display/AM210/Subscribe+to+an+API >>>> [2] - https://docs.wso2.com/display/AM210/Token+API >>>> >>>> Thank you! >>>> >>>> On Sat, Jun 9, 2018 at 9:07 PM shibsankar <[email protected]> wrote: >>>> >>>>> Hi, >>>>> I would like to do the following : >>>>> >>>>> >>>>> *My Objective *: >>>>> >>>>> I have published my API in WSO2 API Gateway. API is working fine. >>>>> >>>>> Now I would like to secure my API with OAuth 2.0. I plan to invoke the >>>>> published API with OAuth 2.0 token from my Angular front-end application. >>>>> >>>>> >>>>> *My Query *: >>>>> How do I get the OAuth 2.0 token? >>>>> >>>>> *Q1*: Do I need to install WSO2 Identity server to get OAuth 2.0 >>>>> token? *Or *I can get OAuth token from WSO2 API Manager itself? >>>>> >>>>> *Q2*: Is there any WSO2 OAuth 2.0 API which provides OAuth token when >>>>> invoked? whats the URL? >>>>> >>>>> Regards >>>>> Shib >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> [email protected] >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>> >>>> >>>> -- >>>> *Pubudu Gunatilaka* >>>> Committer and PMC Member - Apache Stratos >>>> Senior Software Engineer >>>> WSO2, Inc.: http://wso2.com >>>> mobile : +94774078049 >>>> >>>> >>> >> >> -- >> Harsha Kumara >> Associate Technical Lead, WSO2 Inc. >> Mobile: +94775505618 >> Blog:harshcreationz.blogspot.com >> > > -- Harsha Kumara Associate Technical Lead, WSO2 Inc. Mobile: +94775505618 Blog:harshcreationz.blogspot.com
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
