Skip to content

Commit

Permalink
make sure client_id is set in test_generic
Browse files Browse the repository at this point in the history
needed for audience verification
  • Loading branch information
minrk committed Feb 13, 2024
1 parent e6e68fd commit 26ea6fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions oauthenticator/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)

Expand All @@ -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,
)

Expand Down

0 comments on commit 26ea6fa

Please sign in to comment.