Oauth Webdialog VS HTMLDialog


#1

Hi All,

I have a html page that starting by an Authentification base on Google Oauth ( gem devise)

With Chrone, IE or Safari on PC and Mac, my login work.
When I use Webdialog inside Sketchup PRO 2016,2017,2018 on Mac and PC, authentification, work .
but if I use Htmldialog on mc and pc on Sketchup Pro 2018, redirection of Oauth doesn’t work.

1 - the landing page is Display

2 - after clicking on login , a withe page is display without any information:

Normaly this login page should be display

Console of HTMLDIALOG Doesn’t show error ?
It’s like redirection and turbolink doesn’t work with HTMLdialog.

Find below the code of the webdialog that works

		$wcui = UI::WebDialog.new(title, true ,title, 950, 850, 10, 10, true)
		$wcui.navigation_buttons_enabled = true
        url = @options[:serverUrl]
		$wcui.set_url url
		$wcui.allow_actions_from_host(@options[:serverUrl])
		$wcui.show
		@string_from_wcui =""
		@current_index = 0

The code of the HTML DIALOG That doesn’t work

        url = @options[:serverUrl]
		$wcui = UI::HtmlDialog.new(
		{
		  :dialog_title => title,
		  :preferences_key => "com.sample.plugin",
		  :scrollable => true,
		  :resizable => true,
		  :width => 950,
		  :height => 850,
		  :left => 10,
		  :top => 10,
		  :min_width => 50,
		  :min_height => 50,
		  :max_width =>1000,
		  :max_height => 1000,
		  :style => UI::HtmlDialog::STYLE_WINDOW
		})
		$wcui.set_url url
		$wcui.show

Thanks for your help.


#2

Not sure how to help but I find this topic really interesting. Will bookmark so I can learn!

Thanks for posting and I hope it gets solved… Cheers!


#3

Have you tried using something like Fiddler to compare the HTTP requests being sent?


#4

did you test HtmlDialog in v17 ?

there’s a recent post where get location’s HtmlDialog fails to retrieve the terrain, but v17 succeeds…

this may be a similar v18 issue…

john


#5

I did a quick check, and it seems to be related to the js code and whether it’s redirecting within the current page or opening another window/tab.

Try with the two below url’s and you’ll see the difference. In an HtmlDialog, BinTray works (which stays within the current window, Appveyor does not (which opens a child window).

https://ci.appveyor.com/projects
https://bintray.com

Thanks, Greg


#6

Hi Greg , you’re right I try the two url with html.dialog.

On my htmldialog Console/Networks show that redirection is not appening.

@tt_su , I’m coding on mac and try to use Fiddler on another Pc . but due to security raison I was not able to setup auth on the PC. So I can’t achieve to test it.

Thanks All,

I will finnaly use Webdialog ( with all crazy js trouble due to IE, …)