From 26ea6fab876451091c1ab3700ecb2dcd9f921796 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 13 Feb 2024 10:19:21 +0100 Subject: [PATCH] make sure client_id is set in test_generic needed for audience verification --- oauthenticator/tests/test_generic.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oauthenticator/tests/test_generic.py b/oauthenticator/tests/test_generic.py index 04b1e682..af7d5c9e 100644 --- a/oauthenticator/tests/test_generic.py +++ b/oauthenticator/tests/test_generic.py @@ -8,20 +8,23 @@ from ..generic import GenericOAuthenticator from .mocks import setup_oauth_mock +client_id = "jupyterhub-oauth-client" + def user_model(username, **kwargs): """Return a user model""" return { "username": username, + "aud": client_id, "scope": "basic", "groups": ["group1"], **kwargs, } -@fixture(params=[True, False]) +@fixture(params=["id_token", "userdata_url"]) def userdata_from_id_token(request): - return request.param + return request.param == "id_token" @fixture @@ -51,6 +54,7 @@ def _get_authenticator(**kwargs): return GenericOAuthenticator( token_url='https://generic.horse/oauth/access_token', userdata_url='https://generic.horse/oauth/userinfo', + client_id=client_id, **kwargs, ) @@ -59,6 +63,7 @@ def _get_authenticator_for_id_token(**kwargs): return GenericOAuthenticator( token_url='https://generic.horse/oauth/access_token', userdata_from_id_token=True, + client_id=client_id, **kwargs, )