@@ -28,7 +28,6 @@ var Service_ = function(serviceName) {
28
28
this . serviceName_ = serviceName ;
29
29
this . params_ = { } ;
30
30
this . tokenFormat_ = TOKEN_FORMAT . JSON ;
31
- this . stateParameterLocation_ = STATE_PARAMETER_LOCATION . AUTHORIZATION_URL ;
32
31
} ;
33
32
34
33
/**
@@ -70,18 +69,6 @@ Service_.prototype.setTokenFormat = function(tokenFormat) {
70
69
return this ;
71
70
} ;
72
71
73
- /**
74
- * Sets the location of the state parameter, which is required by the
75
- * /usercallback endpoint.
76
- * Default: OAuth2.STATE_PARAMETER_LOCATION.AUTHORIZATION_URL.
77
- * @param {STATE_PARAMETER_LOCATION } tokenFormat The format of the returned token.
78
- * @return {Service_ } This service, for chaining.
79
- */
80
- Service_ . prototype . setStateParameterLocation = function ( stateParameterLocation ) {
81
- this . stateParameterLocation_ = stateParameterLocation
82
- return this ;
83
- } ;
84
-
85
72
/**
86
73
* Sets the project key of the script that contains the authorization callback function (required).
87
74
* The project key can be found in the Script Editor UI under "File > Project properties".
@@ -207,16 +194,10 @@ Service_.prototype.getAuthorizationUrl = function() {
207
194
. createToken ( ) ;
208
195
var params = {
209
196
client_id : this . clientId_ ,
210
- response_type : 'code'
197
+ response_type : 'code' ,
198
+ redirect_uri : redirectUri ,
199
+ state : state
211
200
} ;
212
- if ( this . stateParameterLocation_ == STATE_PARAMETER_LOCATION . AUTHORIZATION_URL ) {
213
- params [ 'state' ] = state ;
214
- } else {
215
- redirectUri = buildUrl_ ( redirectUri , {
216
- state : state
217
- } ) ;
218
- }
219
- params [ 'redirect_uri' ] = redirectUri ;
220
201
params = _ . extend ( params , this . params_ ) ;
221
202
return buildUrl_ ( this . authorizationBaseUrl_ , params ) ;
222
203
} ;
@@ -346,8 +327,9 @@ Service_.prototype.parseToken_ = function(content) {
346
327
/**
347
328
* Refreshes a token that has expired. This is only possible if offline access was
348
329
* requested when the token was authorized.
330
+ * @private
349
331
*/
350
- Service_ . prototype . refresh = function ( ) {
332
+ Service_ . prototype . refresh_ = function ( ) {
351
333
validate_ ( {
352
334
'Client ID' : this . clientId_ ,
353
335
'Client Secret' : this . clientSecret_ ,
0 commit comments