Question

I have implement gmail oAuth in my application, everything works okay.

question is how can i change the image for login button for the gmail account.

I want to make it like Stack overflow.

my code is as below, and i am not able to find how can i change the button given by google for oAuth.

<script type="text/javascript">

    google.load("identitytoolkit", "1.0", { packages: ["ac"] });
</script>
<script type="text/javascript">
    $(function () {
        window.google.identitytoolkit.setConfig({
            developerKey: '<%=ConfigurationManager.AppSettings["developerKey"].ToString() %>',
            companyName: '<%=ConfigurationManager.AppSettings["companyName"].ToString() %>',
            callbackUrl: '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "ResultGmail.aspx",
            realm: "",
            userStatusUrl: '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "Login.aspx",
            loginUrl: '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "Login.aspx",
            signupUrl: '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "ResultGmail.aspx",
            homeUrl: '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "Default.aspx",
            logoutUrl: '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "Default.aspx",
            language: "en",
            idps: ["Gmail"],
            tryFederatedFirst: true,
            useCachedUserStatus: false
        });
        $("#navbar").accountChooser();
    });



</script>

enter image description here

Does this make sense, please let me know if need more detail.

Was it helpful?

Solution

I am not sure what you mean by the Oauth button give by Google? if you want to get the login screen same as the OAuth is using here is the one which use java-script to send user to OpenID system.

Stack overflow do not use OAuth but it uses Open-ID protocol to let user login using any open-ID provider.

here is the project link which uses same login screen as Stack overflow use and if you want only the images and screen layout can use that portion

Open ID Selector

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top