public function testAuthorizeWithRO() { $env = $this->getEnv(); $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID']); $response = $api->authorize_with_ro('*****@*****.**', '123456', 'openid', 'Username-Password-Authentication'); $this->assertArrayHasKey('id_token', $response); $this->assertArrayHasKey('access_token', $response); $this->assertArrayHasKey('token_type', $response); $this->assertEquals('bearer', $response['token_type']); $userinfo = $api->userinfo($response['access_token']); $this->assertArrayHasKey('email', $userinfo); $this->assertArrayHasKey('email_verified', $userinfo); $this->assertArrayHasKey('user_id', $userinfo); $this->assertEquals('*****@*****.**', $userinfo['email']); $this->assertEquals('auth0|57e293c6247600bf0ba47fc2', $userinfo['user_id']); $tokeninfo = $api->tokeninfo($response['id_token']); $this->assertArrayHasKey('email', $tokeninfo); $this->assertArrayHasKey('email_verified', $tokeninfo); $this->assertArrayHasKey('user_id', $tokeninfo); $this->assertEquals('*****@*****.**', $tokeninfo['email']); $this->assertEquals('auth0|57e293c6247600bf0ba47fc2', $tokeninfo['user_id']); }