Skip to content

Commit 48bdbe4

Browse files
committed
chore: fine touches
1 parent 20e6450 commit 48bdbe4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

examples/mock_oidc_server/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
# Configuration
4040
ISSUER = os.environ.get("ISSUER", "http://localhost:3000")
4141
AVAILABLE_SCOPES = os.environ.get("SCOPES", "")
42-
KEY_ID = "1"
4342

4443

4544
@dataclass
4645
class KeyPair:
4746
cache_dir: Path
47+
key_id: str = "1"
4848

4949
jwks: dict = field(init=False)
5050
private_key: str = field(init=False)
@@ -73,7 +73,7 @@ def __post_init__(self):
7373
{
7474
"kty": "RSA",
7575
"use": "sig",
76-
"kid": KEY_ID,
76+
"kid": self.key_id,
7777
"alg": "RS256",
7878
"n": int_to_base64url(public_numbers.n),
7979
"e": int_to_base64url(public_numbers.e),
@@ -274,11 +274,11 @@ async def token(
274274
"iat": now,
275275
"exp": now + expires_delta,
276276
"scope": auth_details["scope"],
277-
"kid": KEY_ID,
277+
"kid": KEY_PAIR.key_id,
278278
},
279279
KEY_PAIR.private_key,
280280
algorithm="RS256",
281-
headers={"kid": KEY_ID},
281+
headers={"kid": KEY_PAIR.key_id},
282282
),
283283
"token_type": "Bearer",
284284
"expires_in": expires_delta.seconds,

examples/mock_oidc_server/templates/login.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@
9999
<h1>Fake Login</h1>
100100
<div class="mock-notice">
101101
<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.
104103
</div>
105104
<p class="info">
106105
Application <strong>{{ client_id }}</strong> is requesting access to

0 commit comments

Comments
 (0)