Ask a Question

Problem Implementing 0Auth 2.0 Authentication through Javascript Language

SajithaVasu
New Contributor

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 7
richie
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,

 

richie

 

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Olga_T
SmartBear Alumni (Retired)

Hi all,

 

@richie, thank you for the reply!

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

 


Olga Terentieva
SmartBear Assistant Community Manager

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 

Olga_T
SmartBear Alumni (Retired)

@SajithaVasu , let's try to refer to our Community experts.

@nmrao , @Radford , @avidCoder , @Lucian , @groovyguy , maybe do you have any ideas on how to implement this?

Your assistance is much appreciated. Thank you in advance!

 


Olga Terentieva
SmartBear Assistant Community Manager

I'll admit I haven't had much occasion to tinker with 0Auth 2.0 Authentication, so I am unfamiliar with that particular topic. I'll see if I can find some information that might be useful though!




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
avidCoder
Super Contributor

I can help to implement OAuth 2.0 authentication through Java language. I have done this before but I am not sure about JavaScript. And Ready API has feature for Oauth 2.0, from where you can directly use that without adding any oauth code. 

https://support.smartbear.com/readyapi/docs/projects/requests/auth/types/oauth2/tutorial.html

 

Though, I have never used this feature. But, you can give it a try.

Olga_T
SmartBear Alumni (Retired)

@avidCoder@groovyguy, thank you so much for your answers!

 

@SajithaVasu, what stage are you on now? Have you managed to achieve the goal yourself, or do you need any further assistance from our experts?

We are looking forward to hearing from you.

 


Olga Terentieva
SmartBear Assistant Community Manager

cancel
Showing results for 
Search instead for 
Did you mean: