Skip to content

Commit aa98f87

Browse files
authored
Add custom_attributes field to SSO Profile. (#434)
1 parent 3f865f1 commit aa98f87

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

tests/test_sso.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def mock_magic_link_profile(self):
2929
idp_id="",
3030
first_name=None,
3131
last_name=None,
32-
profile=None,
32+
role=None,
3333
groups=None,
3434
raw_attributes={},
3535
).dict()

tests/utils/fixtures/mock_profile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class MockProfile(Profile):
66
def __init__(self, id: str):
77
super().__init__(
88
object="profile",
9-
id="prof_01DWAS7ZQWM70PV93BFV1V78QV",
9+
id=id or "prof_01DWAS7ZQWM70PV93BFV1V78QV",
1010
1111
first_name="WorkOS",
1212
last_name="Demo",
@@ -16,10 +16,14 @@ def __init__(self, id: str):
1616
connection_id="conn_01EMH8WAK20T42N2NBMNBCYHAG",
1717
connection_type="OktaSAML",
1818
idp_id="00u1klkowm8EGah2H357",
19+
custom_attributes={
20+
"license": "professional",
21+
},
1922
raw_attributes={
2023
"email": "[email protected]",
2124
"first_name": "WorkOS",
2225
"last_name": "Demo",
2326
"groups": ["Admins", "Developers"],
27+
"license": "professional",
2428
},
2529
)

workos/types/sso/profile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class Profile(WorkOSModel):
2323
idp_id: str
2424
role: Optional[ProfileRole] = None
2525
groups: Optional[Sequence[str]] = None
26-
raw_attributes: Mapping[str, Any]
26+
custom_attributes: Optional[Mapping[str, Any]] = None
27+
raw_attributes: Optional[Mapping[str, Any]] = None
2728

2829

2930
class ProfileAndToken(WorkOSModel):

0 commit comments

Comments
 (0)