# I want to add google social button to my project instead of using the default login page of keycloak

**URL:** <https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967>\
**Category:** Miscellanaeous\
**Created:** [July 27, 2020, 1:59am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967 "2020-07-27T01:59:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sieftt](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/sieftt/32/1136_2.png) [@sieftt](https://forum.keycloak.org/u/sieftt)\
**Post date:** [July 27, 2020, 1:59am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/1 "2020-07-27T01:59:41Z")

</div>

I know all how to configure google IDP, but I want to add google social button to my project instead of using the default login page of keycloak, and I also need to get the accessToken generated by the google login user in keycloak, thank you

---

<div class="post-metadata">

**Author:** ![edewit](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/edewit/32/287_2.png) [@edewit](https://forum.keycloak.org/u/edewit)\
**Post date:** [July 27, 2020, 7:31am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/2 "2020-07-27T07:31:12Z")

</div>

When you want such tight integration with google, why would you want to use keycloak in this case? Seems to me your better of integrating with google directly?

---

<div class="post-metadata">

**Author:** ![sieftt](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/sieftt/32/1136_2.png) [@sieftt](https://forum.keycloak.org/u/sieftt)\
**Post date:** [July 27, 2020, 7:40am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/3 "2020-07-27T07:40:07Z")

</div>

@edewit, Thank you for your suggestions, because my project is protected by keycloak, and keycloak can be easily provided by IDP, so it is more appropriate to use keycloak as authorization authentication. Now, I don’t know how to generate accessToken, just like my registered users through keycloak. And I searched on google for a long time, but did not find a similar solution.

---

<div class="post-metadata">

**Author:** ![edewit](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/edewit/32/287_2.png) [@edewit](https://forum.keycloak.org/u/edewit)\
**Post date:** [July 27, 2020, 9:00am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/4 "2020-07-27T09:00:10Z")

</div>

So if I understand you correct, you want to generate a IDP google button in your webapp without using the keycloak login page? And then still be able to get the accessToken?

If you want a link same as the login page you can do this:

```auto
keycloak.createLoginUrl({
        idpHint: 'google'
});

```

[for more information](https://www.keycloak.org/docs/latest/server_admin/#_client_suggested_idp)

---

<div class="post-metadata">

**Author:** ![sieftt](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/sieftt/32/1136_2.png) [@sieftt](https://forum.keycloak.org/u/sieftt)\
**Post date:** [July 27, 2020, 10:25am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/5 "2020-07-27T10:25:42Z")

</div>

Yes  
Can I get user’s accessToken by this?

---

<div class="post-metadata">

**Author:** ![edewit](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/edewit/32/287_2.png) [@edewit](https://forum.keycloak.org/u/edewit)\
**Post date:** [July 27, 2020, 11:34am UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/6 "2020-07-27T11:34:39Z")

</div>

No, this will enable you to create the login url for your frontend application. To get the accessToken you can use: `keycloak.token`, read more about the [Javascript adapter](https://www.keycloak.org/docs/latest/securing_apps/#_javascript_adapter)

---

<div class="post-metadata">

**Author:** ![sieftt](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/sieftt/32/1136_2.png) [@sieftt](https://forum.keycloak.org/u/sieftt)\
**Post date:** [July 27, 2020, 3:07pm UTC](https://forum.keycloak.org/t/i-want-to-add-google-social-button-to-my-project-instead-of-using-the-default-login-page-of-keycloak/3967/7 "2020-07-27T15:07:54Z")

</div>

ok, I got it  
Thank you so much!
