|
166 | 166 | <cfif len(arguments.proxy)> |
167 | 167 | <cfif listlen(arguments.proxy,"@") eq 2> |
168 | 168 | <cfset stResult.login = listfirst(arguments.proxy,"@") /> |
169 | | - <cfset stResult.user = listfirst(stResult.login,":") /> |
170 | | - <cfset stResult.password = listlast(stResult.login,":") /> |
| 169 | + <cfset stResult.proxyUser = listfirst(stResult.login,":") /> |
| 170 | + <cfset stResult.proxyPassword = listlast(stResult.login,":") /> |
171 | 171 | <cfelse> |
172 | | - <cfset stResult.user = "" /> |
173 | | - <cfset stResult.password = "" /> |
| 172 | + <cfset stResult.proxyUser = "" /> |
| 173 | + <cfset stResult.proxyPassword = "" /> |
174 | 174 | </cfif> |
175 | 175 | <cfset stResult.server = listlast(arguments.proxy,"@") /> |
176 | | - <cfset stResult.domain = listfirst(stResult.server,":") /> |
| 176 | + <cfset stResult.proxyServer = listfirst(stResult.server,":") /> |
177 | 177 | <cfif listlen(stResult.server,":") eq 2> |
178 | | - <cfset stResult.port = listlast(stResult.server,":") /> |
| 178 | + <cfset stResult.proxyPort = listlast(stResult.server,":") /> |
179 | 179 | <cfelse> |
180 | | - <cfset stResult.port = "80" /> |
| 180 | + <cfset stResult.proxyPort = "80" /> |
181 | 181 | </cfif> |
182 | | - <cfelse> |
183 | | - <cfset stResult.user = "" /> |
184 | | - <cfset stResult.password = "" /> |
185 | | - <cfset stResult.domain = "" /> |
186 | | - <cfset stREsult.port = "80" /> |
187 | 182 | </cfif> |
188 | 183 |
|
189 | 184 | <cfreturn stResult /> |
|
219 | 214 | <cfset var stResult = structnew() /> |
220 | 215 | <cfset var stProxy = parseProxy(arguments.proxy) /> |
221 | 216 |
|
222 | | - <cfhttp url="https://accounts.google.com/o/oauth2/token" method="POST" proxyServer="#stProxy.domain#" proxyPort="#stProxy.port#" proxyUser="#stProxy.user#" proxyPassword="#stProxy.password#"> |
| 217 | + <cfhttp url="https://accounts.google.com/o/oauth2/token" method="POST" attributeCollection="#stProxy#"> |
223 | 218 | <cfhttpparam type="formfield" name="code" value="#arguments.authorizationCode#" /> |
224 | 219 | <cfhttpparam type="formfield" name="client_id" value="#arguments.clientID#" /> |
225 | 220 | <cfhttpparam type="formfield" name="client_secret" value="#arguments.clientSecret#" /> |
226 | 221 | <cfhttpparam type="formfield" name="redirect_uri" value="#arguments.redirectURL#" /> |
227 | 222 | <cfhttpparam type="formfield" name="grant_type" value="authorization_code" /> |
228 | 223 | </cfhttp> |
229 | | - |
| 224 | + |
230 | 225 | <cfif not cfhttp.statuscode eq "200 OK"> |
231 | 226 | <cfset throwError(message="Error accessing Google API: #cfhttp.statuscode#",endpoint="https://accounts.google.com/o/oauth2/token",response=cfhttp.filecontent,argumentCollection=arguments) /> |
232 | 227 | </cfif> |
|
248 | 243 | <cfset var stProxy = parseProxy(arguments.proxy) /> |
249 | 244 |
|
250 | 245 | <cfif isdefined("arguments.refresh_token") and datecompare(arguments.access_token_expires,now()) lt 0> |
251 | | - <cfhttp url="https://accounts.google.com/o/oauth2/token" method="POST" proxyServer="#stProxy.domain#" proxyPort="#stProxy.port#" proxyUser="#stProxy.user#" proxyPassword="#stProxy.password#"> |
| 246 | + <cfhttp url="https://accounts.google.com/o/oauth2/token" method="POST" attributeCollection="#stProxy#"> |
252 | 247 | <cfhttpparam type="formfield" name="refresh_token" value="#arguments.refreshToken#" /> |
253 | 248 | <cfhttpparam type="formfield" name="client_id" value="#arguments.clientID#" /> |
254 | 249 | <cfhttpparam type="formfield" name="client_secret" value="#arguments.clientSecret#" /> |
|
278 | 273 | <cfset var stResult = structnew() /> |
279 | 274 | <cfset var stProxy = parseProxy(arguments.proxy) /> |
280 | 275 |
|
281 | | - <cfhttp url="https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=#arguments.accessToken#" method="GET" proxyServer="#stProxy.domain#" proxyPort="#stProxy.port#" proxyUser="#stProxy.user#" proxyPassword="#stProxy.password#" /> |
| 276 | + <cfhttp url="https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=#arguments.accessToken#" method="GET" attributeCollection="#stProxy#" /> |
282 | 277 |
|
283 | 278 | <cfif not cfhttp.statuscode eq "200 OK"> |
284 | 279 | <cfset throwError(message="Error accessing Google API: #cfhttp.statuscode#",endpoint="https://www.googleapis.com/oauth2/v1/tokeninfo",response=cfhttp.filecontent,argumentCollection=arguments) /> |
|
303 | 298 | <cfset var stResult = structnew() /> |
304 | 299 | <cfset var stProxy = parseProxy(arguments.proxy) /> |
305 | 300 |
|
306 | | - <cfhttp url="https://www.googleapis.com/oauth2/v1/userinfo" method="GET" proxyServer="#stProxy.domain#" proxyPort="#stProxy.port#" proxyUser="#stProxy.user#" proxyPassword="#stProxy.password#"> |
| 301 | + <cfhttp url="https://www.googleapis.com/oauth2/v1/userinfo" method="GET" attributeCollection="#stProxy#"> |
307 | 302 | <cfhttpparam type="header" name="Authorization" value="Bearer #arguments.accessToken#" /> |
308 | 303 | </cfhttp> |
309 | | - |
| 304 | + |
310 | 305 | <cfif not cfhttp.statuscode eq "200 OK"> |
311 | 306 | <cfset throwError(message="Error accessing Google API: #cfhttp.statuscode#",endpoint="https://www.googleapis.com/oauth2/v1/userinfo",response=cfhttp.filecontent,argumentCollection=arguments) /> |
312 | 307 | </cfif> |
|
0 commit comments