File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
examples/mock_oidc_server Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 39
39
# Configuration
40
40
ISSUER = os .environ .get ("ISSUER" , "http://localhost:3000" )
41
41
AVAILABLE_SCOPES = os .environ .get ("SCOPES" , "" )
42
- KEY_ID = "1"
43
42
44
43
45
44
@dataclass
46
45
class KeyPair :
47
46
cache_dir : Path
47
+ key_id : str = "1"
48
48
49
49
jwks : dict = field (init = False )
50
50
private_key : str = field (init = False )
@@ -73,7 +73,7 @@ def __post_init__(self):
73
73
{
74
74
"kty" : "RSA" ,
75
75
"use" : "sig" ,
76
- "kid" : KEY_ID ,
76
+ "kid" : self . key_id ,
77
77
"alg" : "RS256" ,
78
78
"n" : int_to_base64url (public_numbers .n ),
79
79
"e" : int_to_base64url (public_numbers .e ),
@@ -274,11 +274,11 @@ async def token(
274
274
"iat" : now ,
275
275
"exp" : now + expires_delta ,
276
276
"scope" : auth_details ["scope" ],
277
- "kid" : KEY_ID ,
277
+ "kid" : KEY_PAIR . key_id ,
278
278
},
279
279
KEY_PAIR .private_key ,
280
280
algorithm = "RS256" ,
281
- headers = {"kid" : KEY_ID },
281
+ headers = {"kid" : KEY_PAIR . key_id },
282
282
),
283
283
"token_type" : "Bearer" ,
284
284
"expires_in" : expires_delta .seconds ,
Original file line number Diff line number Diff line change 99
99
< h1 > Fake Login</ h1 >
100
100
< div class ="mock-notice ">
101
101
< strong > ⚠️ This is a mock authentication server.</ strong >
102
- This is a development/testing server that will automatically generate a
103
- token for a mock user (< code > user123</ code > ) when you click continue.
102
+ This is a development/testing server that will authenticate you as a mock user.
104
103
</ div >
105
104
< p class ="info ">
106
105
Application < strong > {{ client_id }}</ strong > is requesting access to
You can’t perform that action at this time.
0 commit comments