Forum Discussion

SajithaVasu's avatar
New Contributor
5 years ago

Problem Implementing 0Auth 2.0 Authentication through Javascript Language

Hi . I am working on complex calculation project in Ready APi which has scripting language as"javaScript". We would need to implement Authentication in the Composite Project. Could anyone share the script to retrieve the token automatically through Javascript. I am able to retrieve the details automatically through Groovy but i wont be  able to change the project language to groovy as it has more complex language which was implemented using Javascript. It would take more effort to change the language for this issue.


Problem Statement: Need support for oAuth 2.0 Implementation using Javascript. Retrieving token automatically.


So Please anyone share the code to retrieve the token automatically.

7 Replies

  • richie's avatar
    Community Hero

    HI SajithaVasu 


    I've been looking at OAuth quite recently myself and I'm struggling!


    Anyway - this is not the perfect answer you want - but perhaps it can get you further than I did.


    The following link 'Oauth Automation Example' has some JavaScript and groovy to do different parts of what you need.


    The groovy bit is the 'calling the automated retrieval' bit -  there are groovy to javascript converters (no doubt not perfect - but it might get you a little further) - see githublink - this would still need some work on your side I suspect - but it might get you close to what you need?


    sorry I cant be of more help,





    • Olga_T's avatar
      SmartBear Alumni (Retired)

      Hi all,


      richie, thank you for the reply!

      SajithaVasu did this help you? Have you managed to find a solution?


      • SajithaVasu's avatar
        New Contributor

        I am still have the same problem. I am unable to convert the groovy code to Javascript. Problem exists. need a solution to implement authentication using Javascript