@@ -271,3 +271,35 @@ async def test_sends_code_verifier(self, async_workos, httpx_mock):
271271 request = httpx_mock .get_request ()
272272 body = json .loads (request .content )
273273 assert body ["code_verifier" ] == "test_verifier_abc"
274+
275+
276+ class TestGetJwksUrl :
277+ def test_uses_configured_client_id (self , workos ):
278+ url = workos .user_management .get_jwks_url ()
279+ assert url == "https://api.workos.com/sso/jwks/client_test"
280+
281+ def test_explicit_client_id_overrides_default (self , workos ):
282+ url = workos .user_management .get_jwks_url ("client_other" )
283+ assert url == "https://api.workos.com/sso/jwks/client_other"
284+
285+ def test_raises_when_no_client_id_configured (self ):
286+ from workos import WorkOSClient
287+ from workos ._errors import ConfigurationError
288+
289+ client = WorkOSClient (api_key = "sk_test_abc" )
290+ try :
291+ with pytest .raises (ConfigurationError ):
292+ client .user_management .get_jwks_url ()
293+ finally :
294+ client .close ()
295+
296+
297+ @pytest .mark .asyncio
298+ class TestAsyncGetJwksUrl :
299+ async def test_uses_configured_client_id (self , async_workos ):
300+ url = async_workos .user_management .get_jwks_url ()
301+ assert url == "https://api.workos.com/sso/jwks/client_test"
302+
303+ async def test_explicit_client_id_overrides_default (self , async_workos ):
304+ url = async_workos .user_management .get_jwks_url ("client_other" )
305+ assert url == "https://api.workos.com/sso/jwks/client_other"
0 commit comments