How To Handle OAuth 2.0 In Rest Assured

  Рет қаралды 35,336

Mukesh otwani

Mukesh otwani

Күн бұрын

Пікірлер: 86
@chandandurlov
@chandandurlov 2 жыл бұрын
Thanks a lot Mukesh Sir, this solution worked for me....you made my day, If I meet you in person then surely I will give you a treat
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
Awesome chandan I am really glad it worked.. I love treats 😎
@abdulnazer3136
@abdulnazer3136 3 жыл бұрын
Thanks, Mukesh for the simple walkthrough. It truly benefited me a lot!!!
@012dsaini
@012dsaini 3 жыл бұрын
One suggestion, before implementing, if you please describe what is the logic of auth 1.0 and auth 2.0 that will be very helpful. Apart from that content is very helpful.
@positivevibes1769
@positivevibes1769 3 жыл бұрын
Thank you so much for such a wonderful video. really enjoying it.
@chandanrao9856
@chandanrao9856 4 жыл бұрын
Thank you Mukesh, its working absolutely perfect.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Awesome Chandan
@vinitransubhe6794
@vinitransubhe6794 2 жыл бұрын
Thanks Mukesh! Your videos are really helpful to learn the automation.
@dnb1doddi19
@dnb1doddi19 5 жыл бұрын
Great explanation, Mukesh. Thank You.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thanks Mate
@jaspreetdhawan8171
@jaspreetdhawan8171 2 жыл бұрын
Thank you so much for sharing this knowledge Works so well for me :)
@TechTamizh
@TechTamizh 4 жыл бұрын
Thank you so much for your tutorial..you have mentioned only about bearer token and url in this code...but in my case i need to provide header section and body section available..when i tried i was getting 400 error code..how to give header section and body section?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Saran 400 is relate to client error.. given() .header("first_name", "John") .header("last_name", "Watson") .get();
@raviahuja8375
@raviahuja8375 4 жыл бұрын
Thank you so much for this tutorial. Works so well for me :)
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
awesome Ravi..
@vinothinik3405
@vinothinik3405 4 жыл бұрын
I need to automate OAUTH 2 in ready api tool...can you please suggest me which videos can explain it well...
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Vinothini, in ready api just add oauth details like client id,secret, app id and secret
@ParagOak
@ParagOak 5 жыл бұрын
Hi need a help for "how to handle async calls in rest assured" I have a project where post API sends req to couchdb which creates random id. how to validate post status codes for random IDs?
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
HI Parag checkout this post, I guess this covers the same medium.com/@aswathyn/awaitility-handling-async-wait-in-automation-5066e20a1d12
@yemiolu9302
@yemiolu9302 5 жыл бұрын
Hi Mukesh, thank you for the great videos.. Are these videos enough to master Rest Assured?
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
After few more videos yes.
@nevenacukucan1515
@nevenacukucan1515 4 жыл бұрын
Hi Mukesh, nice video!I am trying to automate OAuth2 authorization process for Spotify API using REST Assured - have you had any experience with that?The flow you have shown in this video is one of the three different flows for getting authorized on Spotify and it is also called Client Credentials. This approach, however, gives read-only access to user account. To get a full user authorization, I need to use Authorization flow and this is where things get tricky. The flow requires: getting an authorization code, exchanging that code for an access token and refreshing the access token after it expires. The part that I still have not solved it getting an authorization code, because on this step it is expected that user clicks a button in a browser. Another difference from the example you presented is that redirect Uri is mandatory form parameter for a request.Would you consider creating a video that covers this example?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hi Nevena, this use-case (Spotify) looks very interesting and I will try to cover this scenario in my next video. In this mean while you can check this video which might help kzbin.info/www/bejne/r3K7oIKlobWpoLc
@nevenacukucan1515
@nevenacukucan1515 4 жыл бұрын
@@Mukeshotwani That sounds great, thank you! And thanks for the recommendation - I watched the API University video a couple of days ago, however it didn't provide answers to my dilemmas. I'll make sure to watch it more patiently and I am looking forward to your new video! P.S. I tried to surpass the step when user gives authorization in browser with using Selenium. Instead of using RestAssured to send a GET request, I open the same URL in browser; Selenium enters credentials, logs in; webdriver gets the URL and extracts the authentication code from it. For now, this solution doesn't work, but I plan to continue troubleshooting it. If there is a Java class or library that you would recommend instead of Selenium for this (1st) part of the authorization flow, please do let me know.
@tomzi6582
@tomzi6582 2 жыл бұрын
@Nevena Did you find solution for your issuse?
@theharshaankalgi
@theharshaankalgi 3 жыл бұрын
Working well, Thanks much
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
You're welcome! Harsha
@AliHassan-ux9hi
@AliHassan-ux9hi 5 жыл бұрын
Hi Mukesh, are going to make video on Oauth2.0 handling in soapUI soon? Or if u already have made it can u send the link. I couldn’t find it on KZbin.. thanks for the work u doing..
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Hi Ali, in soapui we have dropdown where we just add values and it will work. Main concept is same.
@AliHassan-ux9hi
@AliHassan-ux9hi 5 жыл бұрын
Mukesh otwani thanks.. I got it.. Keep doing the great work..
@priyaukale3129
@priyaukale3129 2 жыл бұрын
Hi Mukesh, Can we do the authorization filter for specific users on AD groups using oauth or rest assured?
@achintyasett9621
@achintyasett9621 3 жыл бұрын
Hi Mukesh, Its a great video to learn! Thanks for putting so much effort on this. Can you please also upload a video on OAUTH2 based on third-party authorization (e.g. accessing Instagram via Google login)? It will be really helpful! Thanks & Regards, Achintya Sett
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Thank you Achintya good idea will do that.
@sathya-enjoy_lifetothefullest
@sathya-enjoy_lifetothefullest 5 жыл бұрын
Awesome mukesh!!
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Thanks Satya
@saleethmohd
@saleethmohd 4 жыл бұрын
H Mukesh, Can we run OAuth 2.0 related test case parallel? Since once a token is generated the previous token will expire right. So how we will run tests parallel?
@amruthapenigalapati5593
@amruthapenigalapati5593 4 жыл бұрын
Hi Mukesh, Can you please make a video on API Authentication using ApacheHTTPClient and thanks for making the videos it is so helpful.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Yes, sure Amrutha I had only one post and one video on this. Will try to make series on this too but RestAssured internally uses the same lib. learn-automation.com/how-to-perform-web-services-testing-using-httpclient/
@sunnyneluballi2131
@sunnyneluballi2131 4 жыл бұрын
Hi Mukesh, Can you please make a similar for 'AUTH0' (not 0auth) authorization....
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Sure sunny, can you provide any sample api which I can use for videos?
@MrPravinshetty
@MrPravinshetty 4 жыл бұрын
I am getting error Please help ":"unsupported_grant_type","error_description":"Grant type \u0022client-credentials\u0022 not supported and through postman getting { "error": "invalid_request", "error_description": "The grant type was not specified in the request" } error
@justytutka
@justytutka 3 жыл бұрын
Could you please share somewhere working code? I copy the example but I still have errors.
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Hi, can you tell me what error you are getting?
@keshavareddy2239
@keshavareddy2239 2 жыл бұрын
im getting below error for token access request, { "error": "invalid_request", "error_description": "The grant type was not specified in the request" } could you please help me on this? Thanks.
@raunaqt90
@raunaqt90 4 жыл бұрын
Amazing!! Thank you so much Mukesh.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Thanks Raunaq
@surbhidhamija8033
@surbhidhamija8033 9 ай бұрын
Hi mukesh,thanks for sharing. Can you please make a video on grant type -authorization code
@rituthakur8913
@rituthakur8913 2 жыл бұрын
Nice explanation. How to get access token with grant type as Authorization code, where we have a concept of callback url as well ?
@surbhidhamija8033
@surbhidhamija8033 9 ай бұрын
Mukesh could you please make this video also
@R511251
@R511251 4 жыл бұрын
hi Mukesh from Portugal is possible put the second block of code with start Response respose1...inside a method and pass it the token?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hey Raul yes it is possible you can store the response and token variable as global variable and use the same in next method. Just for demo purposes I have used 2 method one for valid and one for invalid.
@R511251
@R511251 4 жыл бұрын
@@Mukeshotwani i tried to did that and the variable wich i take came null...do have email to send theprint and talk a little more?if you want help me or can do from here?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Sure Raul here is the mail mukeshotwani@learn-automation.com please share code along with error screenshot or logs.
@bhavyasrichundru1875
@bhavyasrichundru1875 3 жыл бұрын
Hi Raul, I have the same doubt. Can you please help me how to do it. I'm struck there how to store them in global variables and use in next metho or in other class?
@behindthemask4033
@behindthemask4033 3 жыл бұрын
Hi Mukesh Can you please explain the difference between oAuth1 and oAuth2
@jainanup402
@jainanup402 3 жыл бұрын
How to handle same request if grantype is authorization code
@gagangill8831
@gagangill8831 4 жыл бұрын
mukesh, there is an access token appearing in api response. it expires after every 1 hour. How can i use the access token so that i do not have to change the token over and over again.
@bhavyasrichundru1875
@bhavyasrichundru1875 3 жыл бұрын
Hi Sir, Please explain, how to keep this automation code for auth2.0 in one class and to be called directly in other class. so that we reduce coding in a single class.
@nandkishorkusalkar9803
@nandkishorkusalkar9803 4 жыл бұрын
Thank you Mukesh, Can you make video how we can create hybrid framework with Api with cucumber and scribe java api.
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Hey Nandkishor I have not published all videos for API testing with RestAssured, will try to publish soon.
@nandkishorkusalkar8498
@nandkishorkusalkar8498 4 жыл бұрын
@@Mukeshotwani eagerly waiting for videos ,Thank you Sir.
@t.poulayareddy1704
@t.poulayareddy1704 5 жыл бұрын
Hi Mukesh, Can you please help me with outlook (office 365) login and read mails. I'm not sure from where will get the details to do API call request. I need your suggestion. Thanks in advance.
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
Hi Poulaya, you can get all api's from here docs.microsoft.com/en-us/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations
@reddiranig8083
@reddiranig8083 3 жыл бұрын
Hi Sir, Thank you for this great tutorial. What should be the value of parameter code in case if we are using grant-type as Authorization code ? I'm getting the below error on sending the request as public void getAuthCode() { Response resp = RestAssured.given() .formParam("grant_type", "authorization_code") .formParam("client_id", "xx") .formParam("client_secret", "xyz") .formParam("redirect_uri", "url") .post("${base_uri}/token"); System.out.println(resp.getStatusCode()); System.out.println(resp.asString()); } 400 {"error":"invalid_request","error_description":"Missing parameter: code"} Can you please help me sir ?
@bhar5739
@bhar5739 4 жыл бұрын
Hi Mukesh, Can you please make video on Testing API authentication using Bearer Token with RestAssured?
@Mukeshotwani
@Mukeshotwani 4 жыл бұрын
Sure I will do that. Do you have any sample application which has Bearer Token ?
@bhar5739
@bhar5739 4 жыл бұрын
@@Mukeshotwani No I don't have :(
@grandhim7672
@grandhim7672 3 жыл бұрын
Thanks
@Mukeshotwani
@Mukeshotwani 3 жыл бұрын
Welcome Grandhi.
@grandhim7672
@grandhim7672 3 жыл бұрын
@@Mukeshotwani Thank you so much. your lecture is very clear and helpful. i am new to Rest Assured. but after watching video once, then and there i am able to write code. Many thanks and looking forward for your videos.
@varunmalhotra9374
@varunmalhotra9374 5 жыл бұрын
coop url is not working
@Mukeshotwani
@Mukeshotwani 5 жыл бұрын
@Varrun its working for me.. please check again
@varunmalhotra9374
@varunmalhotra9374 5 жыл бұрын
@@Mukeshotwani done, need help like what to use protractor or selenium for automating web app which is currently on angular and being moved to react?
@santhoshveluri4200
@santhoshveluri4200 4 жыл бұрын
Hi Mukesh.. Thank you soo much for the video. Please help me out how to send client SSL certificates like .pem, .key file as part of post request while generating the access token. I got stuck in my project.. Please help me with the code
@kunu1232
@kunu1232 3 жыл бұрын
Hi Santhosh, Are you able to fix this. Even I am struggling for this since couple of weeks. can you please help if you have the code. Thanking you in Advance.
@abhishekpandey-je6lq
@abhishekpandey-je6lq 3 жыл бұрын
Even I'm stuck at this, Did you get any solution ?
OAuth 2.0 explained with examples
10:03
ByteMonk
Рет қаралды 155 М.
Человек паук уже не тот
00:32
Miracle
Рет қаралды 3,9 МЛН
I tricked MrBeast into giving me his channel
00:58
Jesser
Рет қаралды 30 МЛН
How To Handle OAuth in RestAssured Framework
26:03
Mukesh otwani
Рет қаралды 26 М.
OAuth 2.0 - PKCE
8:49
Sascha Preibisch
Рет қаралды 41 М.
How to Handle Authentication in RestAssured
17:00
Mukesh otwani
Рет қаралды 48 М.
What is OAuth2? How does OAuth2 work? | Naveen AutomationLabs
19:56
Naveen AutomationLabs
Рет қаралды 71 М.
11 - How to use Oauth2.0 in Rest-Assured API Automation ?
17:18
Software Testing And Automation
Рет қаралды 7 М.
OAuth 2.0 and OpenID Connect (in plain English)
1:02:17
OktaDev
Рет қаралды 1,7 МЛН
17. RequestSpecification in Rest Assured
23:56
Retarget Common
Рет қаралды 4,9 М.