>
> (1)  Does  consumer_key and consumer_password has any expiry time?


No, it doesn't expire.



> (2)  I see Token API has responded with Oauth2 token with a field *expires_in
> = 13940*.  Does it mean this token would expire *after 13940 seconds once
> I receive it*?
>

Yes, it is normally set to expire after a certain amount of time(it is
possible to adjust the time[1]).

[1] - https://docs.wso2.com/display/AM210/Client+Credentials+Grant



On Sun, Jun 10, 2018 at 2:31 PM, shibsankar <[email protected]> wrote:

> Yup.  Its working fine now.
>
> I get Oauth2 token now. Please see screenshot (*oauth-token-received
> screenshot attached*)
>
> Also, I can use this token to invoke my published API and I get API
> response ! ! (*api response screenshot attached*)
>
> This is very good.
>
>
> Two question here,
>
> (1)  Does  consumer_key and consumer_password has any expiry time?
> (2)  I see Token API has responded with Oauth2 token with a field *expires_in
> = 13940*.  Does it mean this token would expire *after 13940 seconds once
> I receive it*?
>
> Regards
> Shib
>
>
>
>
>
>
>
> On Sun, Jun 10, 2018 at 1:54 PM, Janak Amarasena <[email protected]> wrote:
>
>> Have you specified a grant type? You need to specify a grant type like
>> bellow (the following is for client credentials grant type);
>>
>>
>>
>>
>> You can directly import curl commands into Postman as well.
>> ​
>> ​Best Regards,
>>
>> On Sun, Jun 10, 2018 at 1:30 PM, shibsankar <[email protected]> wrote:
>>
>>> Yes. I  tested with correct header and base 64 encoded consumer key
>>> value in POSTMAN  now (*postman-testing screenshot attached*)
>>>
>>> Verified that I'm testing with the same parameters and values as shown
>>> by generated curl also.  (*curl-OAuth screenshot attached*)
>>>
>>> Still, No OAuth2 token received.
>>>
>>> What is going wrong?
>>>
>>> Regards
>>> Shib
>>>
>>>
>>> On Sun, Jun 10, 2018 at 12:56 PM, Janak Amarasena <[email protected]>
>>> wrote:
>>>
>>>> Hi Shib,
>>>>
>>>> As I can see the way you're sending the consumer_key and
>>>> consumer_secret is wrong.
>>>>
>>>> It should be in the *Authorization* header in the following form.
>>>>
>>>> *key* = Base64 encoded consumer_key:consumer_secret
>>>>
>>>> and the *Authorization *header value should look like this.
>>>>
>>>> *Authorization: Basic key*
>>>>
>>>>
>>>>
>>>> *​*
>>>> Best Regards,
>>>>
>>>> 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/disp
>>>>>>> lay/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
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Janak Amarasena*
>>>>
>>>> Software Engineer
>>>>
>>>> Email: [email protected]
>>>>
>>>> Mobile: +94777764144
>>>>
>>>> Web: https://wso2.com
>>>>
>>>>
>>>> <http://wso2.com/signature>
>>>>
>>>
>>>
>>
>>
>> --
>> *Janak Amarasena*
>>
>> Software Engineer
>>
>> Email: [email protected]
>>
>> Mobile: +94777764144
>>
>> Web: https://wso2.com
>>
>>
>> <http://wso2.com/signature>
>>
>
>


-- 
*Janak Amarasena*

Software Engineer

Email: [email protected]

Mobile: +94777764144

Web: https://wso2.com


<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to