Issue with CefURLRequest

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Issue with CefURLRequest

Postby obalash » Wed Jan 13, 2021 11:49 am

Hi all,

CefURLRequest works fine for me except for one specific scenario where its behavior i do not understand and cant seem to find a way to cleanly resolve. The scenario is specific to post requests and a server whose authentication is handled by Mcirosfot's azureAD. The scenario is as follows:
1. Launch CEF authenticate and check "keep me signed in"
2. close and relaunch CEF
now at this point if I try to navigate to the server it works fine and i am not prompted for authentciation. but if as my first request in this new session i make a POST CefURLRequest I see in fiddler that it gets routed via 303 to azureAD and appears to get authenticated (this part is expected) but then the same CefURLRequest is sent to the server but instead of being a post request it is now a GET request and the POST payload is discarded. I dont think I am missing any callback but maybe something in my request is malformed. any thoughts on what that might be?

Thanks in advance,
Omer.
obalash
Techie
 
Posts: 16
Joined: Wed Oct 05, 2016 9:18 am

Re: Issue with CefURLRequest

Postby magreenblatt » Wed Jan 13, 2021 1:18 pm

POST data is only supported with 307 redirects. See https://bitbucket.org/chromiumembedded/ ... t-52948539
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Issue with CefURLRequest

Postby obalash » Thu Jan 14, 2021 5:28 am

Hi Marshall,

Thanks a lot for the prompt reply as always. Is there a way for me to identify this scenario from my end? Without parsing the response body. The request object I get during OnRequestComplete doesnt seem to have any indicator the request was replaced with a GET one (the method still appears as POST but the response is 200).

Thanks,
Omer.
obalash
Techie
 
Posts: 16
Joined: Wed Oct 05, 2016 9:18 am

Re: Issue with CefURLRequest

Postby magreenblatt » Thu Jan 14, 2021 11:42 am

If you set the UR_FLAG_STOP_ON_REDIRECT flag then the request will halt on redirects, and you can then handle the redirect in your code.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 31 guests