Search code examples
htmlair

Can you customise Google consent page look when using ouath


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.


Solution

  • 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.