Skip to content

Commit 5859659

Browse files
committed
feat: [AUTH-5739] support extra parameters on M2M Token endpoint
1 parent 9a2909e commit 5859659

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stytch/consumer/api/m2m.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def token(
4545
client_id: str,
4646
client_secret: str,
4747
scopes: Optional[List[str]] = None,
48+
extra: Optional[Dict[str, Any]] = None,
4849
) -> GetTokenResponse:
4950
"""Retrieves an access token for the given M2M Client.
5051
Access tokens are JWTs signed with the project's JWKs, and are valid for one hour after issuance.
@@ -54,9 +55,11 @@ def token(
5455
- client_id: The ID of the client.
5556
- client_secret: The secret of the client.
5657
- scopes: An array of scopes requested. If omitted, all scopes assigned to the client will be returned.
58+
- extra: A map of extra parameters to be passed in the body of the request to the token endpoint
5759
""" # noqa
5860

5961
data: Dict[str, Any] = {
62+
**extra,
6063
"grant_type": "client_credentials",
6164
"client_id": client_id,
6265
"client_secret": client_secret,
@@ -73,6 +76,7 @@ async def token_async(
7376
client_id: str,
7477
client_secret: str,
7578
scopes: Optional[List[str]] = None,
79+
extra: Optional[Dict[str, Any]] = None,
7680
) -> GetTokenResponse:
7781
"""Retrieves an access token for the given M2M Client.
7882
Access tokens are JWTs signed with the project's JWKs, and are valid for one hour after issuance.
@@ -82,9 +86,11 @@ async def token_async(
8286
- client_id: The ID of the client.
8387
- client_secret: The secret of the client.
8488
- scopes: An array scopes requested. If omitted, all scopes assigned to the client will be returned.
89+
- extra: A map of extra parameters to be passed in the body of the request to the token endpoint
8590
""" # noqa
8691

8792
data: Dict[str, Any] = {
93+
**extra,
8894
"grant_type": "client_credentials",
8995
"client_id": client_id,
9096
"client_secret": client_secret,

stytch/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "13.14.1"
1+
__version__ = "13.14.2"

0 commit comments

Comments
 (0)