Tobias Svensson

Allow additional parameters to be passed to authorize call.

@@ -69,13 +69,14 @@ class Service @@ -69,13 +69,14 @@ class Service
69 /** 69 /**
70 * redirect to authorize endpoint of service 70 * redirect to authorize endpoint of service
71 */ 71 */
72 - public function authorize() { 72 + public function authorize(array $userParameters = array()) {
73 - $parameters = array( 73 + $parameters = array_merge($userParameters, array(
74 'type' => 'web_server', 74 'type' => 'web_server',
75 'client_id' => $this->_client->getClientKey(), 75 'client_id' => $this->_client->getClientKey(),
76 'redirect_uri' => $this->_client->getCallbackUrl(), 76 'redirect_uri' => $this->_client->getCallbackUrl(),
77 'response_type' => 'code', 77 'response_type' => 'code',
78 - ); 78 + ));
  79 +
79 if ($this->_scope) { 80 if ($this->_scope) {
80 $parameters['scope'] = $this->_scope; 81 $parameters['scope'] = $this->_scope;
81 } 82 }