private function checkIdTokenFailure($id_token, $msg) { $certs = $this->getSignonCerts(); $oauth2 = new apiOAuth2(); try { $oauth2->verifySignedJwtWithCerts($id_token, $certs, "client_id"); $this->fail("Should have thrown for {$id_token}"); } catch (apiAuthException $e) { $this->assertContains($msg, $e->getMessage()); } }
public function testCreateAuthUrl() { $authUrl = $this->auth->createAuthUrl("http://googleapis.com/scope/foo"); $expected = "https://accounts.google.com/o/oauth2/auth" . "?response_type=code" . "&redirect_uri=http%3A%2F%2Flocalhost" . "&client_id=clientId1" . "&scope=http%3A%2F%2Fgoogleapis.com%2Fscope%2Ffoo" . "&access_type=offline" . "&approval_prompt=force"; $this->assertEquals($expected, $authUrl); }