- Polymer Tutorial
- Polymer - Home
- Polymer - Overview
- Polymer - Installation
- Polymer - Elements
- Polymer - Custom Elements
- Polymer - Shadow DOM and Styling
- Polymer - Events
- Polymer - Data System
- Polymer Useful Resources
- Polymer - Quick Guide
- Polymer - Useful Resources
- Polymer - Discussion
Polymer - Google Signin
<google-signin> is an element used for google authentication, where you can interact with Drive and Google+ APIs. Note − You need to enable the APIs in the Google Developers Console before you use them.
<google-signin client-id = "Your client id" scopes = "https://www.googleapis.com/auth/drive"></google-signin> <google-signin label-signin = "Sign-in" client-id = "Your client id" scopes = "https://www.googleapis.com/auth/drive"></google-signin> <google-signin theme = "dark" width = "iconOnly" client-id = "Your client id" scopes = "https://www.googleapis.com/auth/drive"></google-signin>
Some of the attributes are as follows −
clientId − You can obtain the clientId in the Google Developers Console.
scopes − This attribute defines the necessary scope permissions.
requestVisibleActions − You can use this attribute to write app activities (https://developers.google.com/+/web/app-activities/) on user's behalf.
offline − Using this attribute you can obtain an auth code for your server to save for an offline access token (https://developers.google.com/identity/sign-in/web/server-side-flow).
Use the attributes height, width and theme to style the button by which you can follow the Google+ Sign-In button branding guidelines (https://developers.google.com/+/branding-guidelines).
The events are as follows −
google-signin-success − This event is triggered when a user is authenticated successfully. You can notice the authentication state of a user by using the isAuthorized attribute.
google-signed-out − This event is triggered when a user signs out.
google-signout-attempted − This event is triggered when a user attempts to sign out.
google-signin-offline-success − This event is triggered when a user attempts to sign out.
google-signin-necessary − This event is triggered when additional user permissions are needed by the scopes that are requested via google-signin-aware elements.
To Continue Learning Please Login
Login with Google