@@ -30,7 +30,7 @@ class Google_Config
3030 /**
3131 * Create a new Google_Config. Can accept an ini file location with the
3232 * local configuration. For example:
33- * application_name: "My App";
33+ * application_name= "My App"
3434 *
3535 * @param [$ini_file_location] - optional - The location of the ini file to load
3636 */
@@ -78,10 +78,14 @@ public function __construct($ini_file_location = null)
7878 'developer_key ' => '' ,
7979
8080 // Other parameters.
81- 'access_type ' => 'online ' ,
82- 'approval_prompt ' => 'auto ' ,
81+ 'hd ' => '' ,
82+ 'prompt ' => '' ,
83+ 'openid.realm ' => '' ,
84+ 'include_granted_scopes ' => '' ,
8385 'login_hint ' => '' ,
8486 'request_visible_actions ' => '' ,
87+ 'access_type ' => 'online ' ,
88+ 'approval_prompt ' => 'auto ' ,
8589 'federated_signon_certs_url ' =>
8690 'https://www.googleapis.com/oauth2/v1/certs ' ,
8791 ),
@@ -297,6 +301,53 @@ public function setDeveloperKey($key)
297301 $ this ->setAuthConfig ('developer_key ' , $ key );
298302 }
299303
304+ /**
305+ * Set the hd (hosted domain) parameter streamlines the login process for
306+ * Google Apps hosted accounts. By including the domain of the user, you
307+ * restrict sign-in to accounts at that domain.
308+ * @param $hd string - the domain to use.
309+ */
310+ public function setHostedDomain ($ hd )
311+ {
312+ $ this ->setAuthConfig ('hd ' , $ hd );
313+ }
314+
315+ /**
316+ * Set the prompt hint. Valid values are none, consent and select_account.
317+ * If no value is specified and the user has not previously authorized
318+ * access, then the user is shown a consent screen.
319+ * @param $prompt string
320+ */
321+ public function setPrompt ($ prompt )
322+ {
323+ $ this ->setAuthConfig ('prompt ' , $ prompt );
324+ }
325+
326+ /**
327+ * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth
328+ * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which
329+ * an authentication request is valid.
330+ * @param $realm string - the URL-space to use.
331+ */
332+ public function setOpenidRealm ($ realm )
333+ {
334+ $ this ->setAuthConfig ('openid.realm ' , $ realm );
335+ }
336+
337+ /**
338+ * If this is provided with the value true, and the authorization request is
339+ * granted, the authorization will include any previous authorizations
340+ * granted to this user/application combination for other scopes.
341+ * @param $include boolean - the URL-space to use.
342+ */
343+ public function setIncludeGrantedScopes ($ include )
344+ {
345+ $ this ->setAuthConfig (
346+ 'include_granted_scopes ' ,
347+ $ include ? "true " : "false "
348+ );
349+ }
350+
300351 /**
301352 * @return string the base URL to use for API calls
302353 */
0 commit comments