Can you customise Google consent page look when using ouath
Asked Answered
S

1

2

As the title says I am trying to customise the page that you get from Google when user needs to log in and authorise your app. I am not having any problems with authorisation, redirections and token exchanges but only with the visual style of this form. To be more precise I have a HTML component (a web browser view) in my AIR app which is 200px wide but the dialogue which I get from Google is wider and doesn't fit into the view.

Is there a way to turn min-width of the dialogue and scale it to 200px? For example: what would one do if all you have is 240px of a webview like for example on Android phones with small resolution? Are there any get parameters or alternative urls for these situations other than https://accounts.google.com/o/oauth2/auth? Also I would like to get a page with "Dark theme" if there is some option for that too but this is not crucial.

Schaffer answered 22/10, 2013 at 15:55 Comment(4)
Did you find any solution for this? I'm struggling to get the confirmation page to fit the Windows Phone screen.Sericeous
I have done it using an awful, awful hack. Since I am opening this inside a HTML component inside AIR app I just execute custom Javascript after load to modify the DOM tree. Be warned that I am not quite certain this workaround is not against Google policies. Same thing can be done on Android and I think Windows phone browser component could allow the same.Suspicion
It's a shame Google doesn't have a query parameter to set the confirmation page size. Anything like confirmation_page_width=200 would be immensely helpful.Sericeous
I totally agree, because as I said imagine using that confirmation on 240 x 320... They could at least make it responsive design so it resizes properly. NOTE: I hope you fixed your problem but if you are still trying you could just set page zoom from Javascript as I did.Suspicion
F
4

How I solved it on Android:

    view.loadUrl("javascript:(function() { "
            + "document.getElementsByClassName('signin-card')[0].style.width = 'auto';" + "})()");

Let us never speak of this again.

Fiftyfifty answered 18/12, 2013 at 11:23 Comment(2)
Hahaha!Awesome! I did some similar javascript hack but all in all it appears that modifying dom after load is the only way.Suspicion
Please guide on this : #49362904Fact

© 2022 - 2024 — McMap. All rights reserved.