Forum Discussion

troyyerJP's avatar
troyyerJP
Contributor
8 months ago

ReadyAPI OAuth 2.0 Auth Automation Script for multiple user profiles

Hi there,

I would like some help with setting up the Auth Repository for an API suite we have to test

so the test API is a customer facing API where we first authenticate the end user and then use the token in subsequent calls for that user.

I have created the 1 Oauth Profile and set up the configuration for the client ID, secret as well as set up the Automation flow. so this works correctly for 1 end user. Now here are some of my doubts. 

1) If I have to test multiple end users (we would want to test with 10 users having different access controls on those profiles) is there anyway to do this without having to duplicate the full auth profile with all the configurations and automation code into each profile separately?

2) I have to test this in 2 different environments. So with my requirements of needing 10 users, would I have to set up 20 different profiles for this? Is there anyway to use some of the Environment Variables to change the information as required? 

3) I cant find anything in the documentation or the ReadyAPI right click option, but is it possible to get the Project related Variables within the Oauth Automation Script? eg in Groovy scripts we can use 

context.expand( '${#Project#VarUserMember}' );

I am mainly trying to remove a lot of  unnecessary code duplication within our repo for these requirements. Any guidance would be greatly appreciated.  

No RepliesBe the first to reply