We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
 Ask Your Question

# Revision history [back]

Hi Milos!

First of all I'll assume that your issue is retrieving the Authorization token. We've tested several ways Authorization Code Grand and Owner Password Credentials Grant on Javascript and it worked.

For the first one, here you have a simple example on how to retrieve it (redirect needed).

For the second one, here's an example of how we've used it in our application.

We also made a simple script in bash to retrieve a fresh token (just replace CLIENTSECRET, CLIENTID and the HOST)

Finally, and based on the first example, we've made an auth.js that works following the Authorization Code Grant type.

Regarding the ClientID and Client Secret, those are the ones that build the header Authorization: Basic. This header is a must in every request you make against KeyRock.

Hints: make sure you configure properly the URL of your application and the callback URL at KeyRock and at your application; and also, that the header Authorization: Basic XXXXXXXXXXXXXXXXXXX is there and with the base64 encoding.

Hope is clear enough, but let me know if you have any doubts :)

Hi Milos!

First of all I'll assume that your issue is retrieving the Authorization token. We've tested several ways Authorization Code Grand and Owner Password Credentials Grant on Javascript and it worked.

For the first one, here you have a simple example on how to retrieve it (redirect needed).

For the second one, here's an example of how we've used it in our application.

We also made a simple script in bash to retrieve a fresh token (just replace CLIENTSECRET, CLIENTID and the HOST)CLIENT_SECRET, CLIENT_ID and the HOST in the REQUEST)

Finally, and based on the first example, we've made an auth.js that works following the Authorization Code Grant type.

Regarding the ClientID and Client Secret, those are the ones that build the header Authorization: Basic. This header is a must in every request you make against KeyRock.

Hints: make sure you configure properly the URL of your application and the callback URL at KeyRock and at your application; and also, that the header Authorization: Basic XXXXXXXXXXXXXXXXXXX is there and with the base64 encoding.

Hope is clear enough, but let me know if you have any doubts :)