Contributions
Re: How to really get the OAuth 2 token automatically
Hey Nastya, We don't have the resourse owners ID or password, so we have to use "Authorization Code Grant", there is no logon screen, it just pops up the code. I want to grab that from the browser, place it in a variable and close the browser. Not sure how to do that.5 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.9KViews0likes1CommentRe: How to really get the OAuth 2 token automatically
Thanks Nastya_Khovrina, I've read this article about 40 times and get nothing from it. I'm lost in the Auth Manager, I can't get an access token unless I use "Authorization Code Grant" and it only gives it to me in a web browser that I can do nothing with. Are there any classes on OAuth 2 with ReadyAPI? Maybe that would be helpful. Like a course for dummies. I'm not a dummy, but don't deal with websites very often, mostly do background stuff in PowerShell, Ruby, VBA and such.5 years agoPlace ReadyAPI QuestionsReadyAPI Questions6.2KViews0likes3CommentsRe: How to really get the OAuth 2 token automatically
I have a question, where does the token go? Where do I retrieve it to put into my "Authorization" part of the header. I see in the loop that it waits for a new token and then just ends...5 years agoPlace ReadyAPI QuestionsReadyAPI Questions6.2KViews0likes6CommentsRe: How to really get the OAuth 2 token automatically
Thank Cekay, that didn't work for me, I must be missing something. First of all, all of the if code that is associated with the submit. didn't work. When I commented that out, the token is still blank. Do you have any Java code on the OAuth 2 script for page 1 and page 2.5 years agoPlace ReadyAPI QuestionsReadyAPI Questions6.3KViews0likes10CommentsHow to really get the OAuth 2 token automatically
I wrote some code that gets an access token. When the code runs, a browser displays on the screen which contains the access token. But when I try to get the access token and log it, a null string is being displayed. Also, I do not know if there is a way to force the browser to close using my code. Right now when I run this code, the browser window opens but I have to click on it to close it. Could you please let me know what I am doing wrong ? Groovy Code: import com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade import com.eviware.soapui.support.editor.inspectors.auth.TokenType def project = context.getTestCase().getTestSuite().getProject(); def oAuthProfile = project.getAuthRepository().getEntry("IMAGEN_Profile"); def clientSecret = testRunner.testCase.testSuite.getPropertyValue("Client_Secret") def clientID = testRunner.testCase.testSuite.getPropertyValue("Client_ID") oAuthProfile.setClientSecret(clientSecret); oAuthProfile.setClientID(clientID); log.info("Client Secret:"+clientSecret) log.info("Client ID:"+clientID) // the following code for getting new access token def oAuthClientFacade = new OltuOAuth2ClientFacade(TokenType.ACCESS); oAuthClientFacade.requestAccessToken(oAuthProfile, true); def accessToken = oAuthProfile.getAccessToken() testRunner.testCase.testSuite.setPropertyValue("Auth_Code",accessToken) log.info("Access Token:"+accessToken)Solved5 years agoPlace ReadyAPI QuestionsReadyAPI Questions7.4KViews0likes12Comments