@@ -142,18 +142,19 @@ class UsersIdTokenTestBase(unittest.TestCase):
142142 _SAMPLE_TIME_NOW = 1360964700
143143 _SAMPLE_OAUTH_SCOPES = ['https://www.googleapis.com/auth/userinfo.email' ]
144144 _SAMPLE_OAUTH_TOKEN_INFO = {
145- 'issued_to' : ('919214422084-c0jrodnkm7ntttjhhttilqjq5d7l7mu5.apps.'
146- 'googleusercontent.com' ),
147- 'user_id' : '108495933693426793887' ,
148- 'expires_in' : 3384 ,
149145 'access_type' : 'online' ,
150- 'audience' : ('919214422084-c0jrodnkm7ntttjhhttilqjq5d7l7mu5.apps.'
146+ 'aud' : ('919214422084-c0jrodnkm7ntttjhhttilqjq5d7l7mu5.apps.'
147+ 'googleusercontent.com' ),
148+ 'azp' : ('919214422084-c0jrodnkm7ntttjhhttilqjq5d7l7mu5.apps.'
151149 'googleusercontent.com' ),
150+ 'email' : 'kevind@gmail.com' ,
151+ 'email_verified' : 'true' ,
152+ 'exp' : str (_SAMPLE_TIME_NOW + 3384 ),
153+ 'expires_in' : 3384 ,
152154 'scope' : (
153155 'https://www.googleapis.com/auth/userinfo.profile '
154156 'https://www.googleapis.com/auth/userinfo.email' ),
155- 'email' : 'kevind@gmail.com' ,
156- 'verified_email' : True
157+ 'sub' : '108495933693426793887' ,
157158 }
158159
159160 def setUp (self ):
@@ -431,7 +432,7 @@ class DummyResponse(object):
431432 status_code = 200
432433 content = json .dumps (token )
433434
434- expected_uri = 'https://www.googleapis.com/oauth2/v1 /tokeninfo?access_token=unused_token'
435+ expected_uri = 'https://www.googleapis.com/oauth2/v3 /tokeninfo?access_token=unused_token'
435436 with mock .patch .object (urlfetch , 'fetch' ) as mock_fetch :
436437 mock_fetch .return_value = DummyResponse ()
437438 users_id_token ._set_bearer_user_vars_local (
@@ -454,10 +455,10 @@ def assertOauthLocalFailed(self, token_update):
454455 self .assertNotIn ('ENDPOINTS_AUTH_DOMAIN' , os .environ )
455456
456457 def testOauthLocalBadEmail (self ):
457- self .assertOauthLocalFailed ({'verified_email ' : False })
458+ self .assertOauthLocalFailed ({'email_verified ' : 'false' })
458459
459460 def testOauthLocalBadClientId (self ):
460- self .assertOauthLocalFailed ({'issued_to ' : 'abc.appspot.com' })
461+ self .assertOauthLocalFailed ({'azp ' : 'abc.appspot.com' })
461462
462463 def testOauthLocalBadScopes (self ):
463464 self .assertOauthLocalFailed ({'scope' : 'useless_scope and_another' })
0 commit comments