|
@@ -12,8 +12,8 @@ discard block |
|
|
block discarded – undo |
|
12
|
12
|
use Webmozart\Assert\Assert; |
|
13
|
13
|
|
|
14
|
14
|
$base = dirname(dirname(dirname(dirname(__FILE__)))); |
|
15
|
|
-$default = dirname($base) . '/oauth/libextinc/OAuth.php'; |
|
16
|
|
-$travis = $base . '/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php'; |
|
|
15
|
+$default = dirname($base).'/oauth/libextinc/OAuth.php'; |
|
|
16
|
+$travis = $base.'/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php'; |
|
17
|
17
|
|
|
18
|
18
|
if (file_exists($default)) { |
|
19
|
19
|
require_once($default); |
|
@@ -75,7 +75,7 @@ discard block |
|
|
block discarded – undo |
|
75
|
75
|
|
|
76
|
76
|
$configObject = Configuration::loadFromArray( |
|
77
|
77
|
$config, |
|
78
|
|
- 'authsources[' . var_export($this->authId, true) . ']' |
|
|
78
|
+ 'authsources['.var_export($this->authId, true).']' |
|
79
|
79
|
); |
|
80
|
80
|
|
|
81
|
81
|
$this->key = $configObject->getString('key'); |
|
@@ -105,8 +105,8 @@ discard block |
|
|
block discarded – undo |
|
105
|
105
|
'https://api.twitter.com/oauth/request_token', |
|
106
|
106
|
['oauth_callback' => $linkback] |
|
107
|
107
|
); |
|
108
|
|
- Logger::debug("Got a request token from the OAuth service provider [" . |
|
109
|
|
- $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); |
|
|
108
|
+ Logger::debug("Got a request token from the OAuth service provider [". |
|
|
109
|
+ $requestToken->key."] with the secret [".$requestToken->secret."]"); |
|
110
|
110
|
|
|
111
|
111
|
$state['authtwitter:authdata:requestToken'] = $requestToken; |
|
112
|
112
|
Auth\State::saveState($state, self::STAGE_INIT); |
|
@@ -143,8 +143,8 @@ discard block |
|
|
block discarded – undo |
|
143
|
143
|
|
|
144
|
144
|
$consumer = new Consumer($this->key, $this->secret); |
|
145
|
145
|
|
|
146
|
|
- Logger::debug("oauth: Using this request token [" . |
|
147
|
|
- $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); |
|
|
146
|
+ Logger::debug("oauth: Using this request token [". |
|
|
147
|
+ $requestToken->key."] with the secret [".$requestToken->secret."]"); |
|
148
|
148
|
|
|
149
|
149
|
// Replace the request token with an access token |
|
150
|
150
|
$accessToken = $consumer->getAccessToken( |
|
@@ -152,12 +152,12 @@ discard block |
|
|
block discarded – undo |
|
152
|
152
|
$requestToken, |
|
153
|
153
|
$parameters |
|
154
|
154
|
); |
|
155
|
|
- Logger::debug("Got an access token from the OAuth service provider [" . |
|
156
|
|
- $accessToken->key . "] with the secret [" . $accessToken->secret . "]"); |
|
|
155
|
+ Logger::debug("Got an access token from the OAuth service provider [". |
|
|
156
|
+ $accessToken->key."] with the secret [".$accessToken->secret."]"); |
|
157
|
157
|
|
|
158
|
158
|
$verify_credentials_url = 'https://api.twitter.com/1.1/account/verify_credentials.json'; |
|
159
|
159
|
if ($this->include_email) { |
|
160
|
|
- $verify_credentials_url = $verify_credentials_url . '?include_email=true'; |
|
|
160
|
+ $verify_credentials_url = $verify_credentials_url.'?include_email=true'; |
|
161
|
161
|
} |
|
162
|
162
|
$userdata = $consumer->getUserInfo($verify_credentials_url, $accessToken); |
|
163
|
163
|
|
|
@@ -171,13 +171,13 @@ discard block |
|
|
block discarded – undo |
|
171
|
171
|
$attributes = []; |
|
172
|
172
|
foreach ($userdata as $key => $value) { |
|
173
|
173
|
if (is_string($value)) { |
|
174
|
|
- $attributes['twitter.' . $key] = [(string) $value]; |
|
|
174
|
+ $attributes['twitter.'.$key] = [(string) $value]; |
|
175
|
175
|
} |
|
176
|
176
|
} |
|
177
|
177
|
|
|
178
|
|
- $attributes['twitter_at_screen_name'] = ['@' . $userdata['screen_name']]; |
|
179
|
|
- $attributes['twitter_screen_n_realm'] = [$userdata['screen_name'] . '@twitter.com']; |
|
180
|
|
- $attributes['twitter_targetedID'] = ['http://twitter.com!' . $userdata['id_str']]; |
|
|
178
|
+ $attributes['twitter_at_screen_name'] = ['@'.$userdata['screen_name']]; |
|
|
179
|
+ $attributes['twitter_screen_n_realm'] = [$userdata['screen_name'].'@twitter.com']; |
|
|
180
|
+ $attributes['twitter_targetedID'] = ['http://twitter.com!'.$userdata['id_str']]; |
|
181
|
181
|
|
|
182
|
182
|
$state['Attributes'] = $attributes; |
|
183
|
183
|
} |