Retrieve authorization method in Auth Manager using Java Script assertion in Ready API
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Retrieve authorization method in Auth Manager using Java Script assertion in Ready API
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Lokesh777,
ReadyAPI supports multiple types of authorization. Please refer to the following article for details:
https://support.smartbear.com/readyapi/docs/projects/requests/auth/index.html
If the article doesn't help, could you please clarify your request? What exactly do you want to implement?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @TanyaYatskovska ,
We are using Java Script as "Script Language" for our Rest Project.
In one of our tests, I need to retrieve the Authorization which has been set for the project currently.
So ,I need to retrieve the "Profile name" from Auth Manager which has been set in a script assertion.
I am expecting a possible soultion for this.
Thanks in advance 🙂
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Lokesh777,
This JavaScript code retrieves the auth method set for your project in the current environment and posts its name to the log:
var auth = context.testCase.testSuite.project.getAuthProfileHolder().getAuthProfile(); log.info(auth);
A video showing how it works for me is attached.
I hope this is what you were looking for.
Customer Care Team
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks everyone for looking into this.
@Lokesh777, is this what you were looking for? Can we mark Natalie's reply as a solution?
Olga Terentieva
SmartBear Assistant Community Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
