mcp-authkit 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/PKG-INFO +1 -1
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcp_authkit.egg-info/PKG-INFO +1 -1
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/oauth_provider.py +34 -13
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/pyproject.toml +1 -1
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/LICENSE +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/README.md +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcp_authkit.egg-info/SOURCES.txt +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcp_authkit.egg-info/dependency_links.txt +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcp_authkit.egg-info/requires.txt +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcp_authkit.egg-info/top_level.txt +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/__init__.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/auth_middleware.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/auth_routes.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/jwt_validator.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/__init__.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/credentials_provider.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/base.html +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/credentials_entry.html +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/credentials_error.html +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/credentials_success.html +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/oauth_error.html +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/oauth_success.html +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/py.typed +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/__init__.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/base.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/encryption.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/factory.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/file_store.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/memory.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/store/redis_store.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/setup.cfg +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/tests/test_auth_middleware.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/tests/test_auth_routes.py +0 -0
- {mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/tests/test_jwt_validator.py +0 -0
|
@@ -208,10 +208,11 @@ class OAuthProvider:
|
|
|
208
208
|
refresh_token_fn: Callable[..., Coroutine[Any, Any, ExchangeResult]] | None = None,
|
|
209
209
|
token_timeout: float = 120.0,
|
|
210
210
|
http_verify: bool | ssl.SSLContext | str = True,
|
|
211
|
+
extra_authorize_params: dict[str, str] | None = None,
|
|
211
212
|
) -> OAuthProvider:
|
|
212
213
|
"""
|
|
213
214
|
Convenience factory for any standard OAuth2 Authorization Code provider
|
|
214
|
-
(GitHub, Google, Jira, Entra, etc.).
|
|
215
|
+
(GitHub, Google, Jira, Entra, Okta, etc.).
|
|
215
216
|
|
|
216
217
|
Builds ``build_auth_url`` and ``exchange_code`` internally from standard
|
|
217
218
|
OAuth2 endpoints so the caller only needs to supply configuration::
|
|
@@ -242,6 +243,25 @@ class OAuthProvider:
|
|
|
242
243
|
Space-separated scope string.
|
|
243
244
|
http_verify
|
|
244
245
|
Passed as ``verify=`` to httpx for the token exchange request.
|
|
246
|
+
extra_authorize_params
|
|
247
|
+
Optional extra query parameters appended to every authorization URL.
|
|
248
|
+
Use this for provider-specific routing hints that are not part of the
|
|
249
|
+
standard OAuth2 spec. For example, Okta supports an ``idp`` parameter
|
|
250
|
+
to bypass its login page and route users directly to a configured
|
|
251
|
+
external Identity Provider::
|
|
252
|
+
|
|
253
|
+
okta = OAuthProvider.from_standard_oauth2(
|
|
254
|
+
name="okta",
|
|
255
|
+
authorization_url="https://your-org.okta.com/oauth2/default/v1/authorize",
|
|
256
|
+
token_url="https://your-org.okta.com/oauth2/default/v1/token",
|
|
257
|
+
...
|
|
258
|
+
extra_authorize_params={"idp": "0oaz2r21a8RBmZyOL0h7"},
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
These parameters are merged into the standard ones
|
|
262
|
+
(``client_id``, ``redirect_uri``, ``scope``, ``state``,
|
|
263
|
+
``response_type``). Standard parameters always take precedence so
|
|
264
|
+
they cannot be overridden here. Default: ``None`` (no extra params).
|
|
245
265
|
token_store
|
|
246
266
|
Optional persistent store override.
|
|
247
267
|
pending_store
|
|
@@ -251,19 +271,20 @@ class OAuthProvider:
|
|
|
251
271
|
"""
|
|
252
272
|
|
|
253
273
|
def _build_auth_url(state: str, redir: str) -> str:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
274
|
+
params: dict[str, str] = {}
|
|
275
|
+
if extra_authorize_params:
|
|
276
|
+
params.update(extra_authorize_params)
|
|
277
|
+
# Standard params always win over any extra ones
|
|
278
|
+
params.update(
|
|
279
|
+
{
|
|
280
|
+
"client_id": client_id,
|
|
281
|
+
"redirect_uri": redir,
|
|
282
|
+
"scope": scope,
|
|
283
|
+
"state": state,
|
|
284
|
+
"response_type": "code",
|
|
285
|
+
}
|
|
266
286
|
)
|
|
287
|
+
return authorization_url + "?" + urlencode(params)
|
|
267
288
|
|
|
268
289
|
async def _exchange_code(code: str, state: str, redir: str) -> ExchangeResult:
|
|
269
290
|
async with httpx.AsyncClient(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/credentials_entry.html
RENAMED
|
File without changes
|
{mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/credentials_error.html
RENAMED
|
File without changes
|
{mcp_authkit-0.2.1 → mcp_authkit-0.2.2}/mcpauthkit/providers/templates/credentials_success.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|