Skip to content

Commit afcc936

Browse files
committed
GH-9: Each client config can have its claim mappings
1 parent 367374f commit afcc936

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/fastapi_oauth2/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from typing import Optional
22
from typing import Sequence
33
from typing import Type
4+
from typing import Union
45

56
from social_core.backends.oauth import BaseOAuth2
67

8+
from .claims import Claims
9+
710

811
class OAuth2Client:
912
"""OAuth2 client configuration for a single provider."""
@@ -13,6 +16,7 @@ class OAuth2Client:
1316
client_secret: str
1417
redirect_uri: Optional[str]
1518
scope: Optional[Sequence[str]]
19+
claims: Optional[Union[Claims, dict]]
1620

1721
def __init__(
1822
self,
@@ -22,9 +26,11 @@ def __init__(
2226
client_secret: str,
2327
redirect_uri: Optional[str] = None,
2428
scope: Optional[Sequence[str]] = None,
29+
claims: Optional[Union[Claims, dict]] = None,
2530
) -> None:
2631
self.backend = backend
2732
self.client_id = client_id
2833
self.client_secret = client_secret
2934
self.redirect_uri = redirect_uri
3035
self.scope = scope or []
36+
self.claims = Claims(claims)

0 commit comments

Comments
 (0)