Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: lib/src/google-signin/google-signin.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/google-map/google-map-search.html ('k') | lib/src/google-signin/google-signin-aware.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/google-signin/google-signin.html
diff --git a/lib/src/google-signin/google-signin.html b/lib/src/google-signin/google-signin.html
index 5bf7f958ce969abc2797613130750ee5c3f712c3..b8496df0118aef57de4253a659843ef16a7dd7c2 100644
--- a/lib/src/google-signin/google-signin.html
+++ b/lib/src/google-signin/google-signin.html
@@ -17,6 +17,9 @@
client-id="{{clientId}}"
cookie-policy="{{cookiePolicy}}"
request-visible-actions="{{requestVisibleActions}}"
+ hosted-domain="{{hostedDomain}}"
+ offline="{{offline}}"
+ offline-always-prompt="{{offlineAlwaysPrompt}}"
scopes="{{scopes}}"
signed-in="{{signedIn}}"
is-authorized="{{isAuthorized}}"
@@ -144,6 +147,13 @@ activities (https://developers.google.com/+/web/app-activities/) on behalf of
the user. Please note that this attribute is only valid in combination with the
plus.login scope (https://www.googleapis.com/auth/plus.login).
+The `offline` attribute allows you to get an auth code which your server can
+redeem for an offline access token
+(https://developers.google.com/identity/sign-in/web/server-side-flow).
+You can also set `offline-always-prompt` instead of `offline` to ensure that your app
+will re-prompt the user for offline access and generate a working `refresh_token`
+even if they have already granted offline access to your app in the past.
+
Use label properties to customize prompts.
The button can be styled in using the `height`, `width`, and `theme` attributes.
@@ -151,12 +161,15 @@ These attributes help you follow the Google+ Sign-In button branding guidelines
(https://developers.google.com/+/branding-guidelines).
The `google-signin-success` event is triggered when a user successfully authenticates
-and `google-signed-out` is triggered when user signeds out.
+and `google-signed-out` is triggered when user signs out.
You can also use `isAuthorized` attribute to observe user's authentication state.
Additional events, such as `google-signout-attempted` are
triggered when the user attempts to sign-out and successfully signs out.
+When requesting offline access, the `google-signin-offline-success` event is
+triggered when the user successfully consents with offline support.
+
The `google-signin-necessary` event is fired when scopes requested via
google-signin-aware elements require additional user permissions.
@@ -197,6 +210,14 @@ any apps you're building. See the Google Developers Console
*/
/**
+ * Fired when an offline authorization is successful.
+ * @event google-signin-offline-success
+ * @param {Object} detail
+ * @param {string} detail.code The one-time authorization code from Google.
+ * Your application can exchange this for an `access_token` and `refresh_token`
+ */
+
+ /**
* Fired when this scope is not authorized
* @event google-signin-aware-signed-out
*/
@@ -287,6 +308,7 @@ any apps you're building. See the Google Developers Console
type: String,
computed: '_computeSigninLabel(labelSignin, width, _brand)'
},
+
/**
* An optional label for the sign-out button.
*/
@@ -313,6 +335,33 @@ any apps you're building. See the Google Developers Console
},
/**
+ * The Google Apps domain to which users must belong to sign in.
+ * See the relevant [docs](https://developers.google.com/identity/sign-in/web/reference) for more information.
+ */
+ hostedDomain: {
+ type: String,
+ value: ''
+ },
+
+ /**
+ * Allows for offline `access_token` retrieval during the signin process.
+ */
+ offline: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
+ * Forces a re-prompt, even if the user has already granted offline
+ * access to your application in the past. You only need one of
+ * `offline` and `offlineAlwaysPrompt`.
+ */
+ offlineAlwaysPrompt: {
+ type: Boolean,
+ value: false
+ },
+
+ /**
* The scopes to provide access to (e.g https://www.googleapis.com/auth/drive)
* and should be space-delimited.
*/
« no previous file with comments | « lib/src/google-map/google-map-search.html ('k') | lib/src/google-signin/google-signin-aware.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698