Skip to content

Commit 4abe36b

Browse files
authored
Expose raw_attributes on WorkOSProfile (#36)
* On the API, we recently exposed raw_attributes, the original profile response we receive from the IdP. This update passes this data through the SDK. * Updates the SDK to 0.5.0
1 parent 9c15ceb commit 4abe36b

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

tests/test_sso.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def mock_profile(self):
2828
"last_name": "Demo",
2929
"connection_type": "OktaSAML",
3030
"idp_id": "00u1klkowm8EGah2H357",
31+
"raw_attributes": {
32+
"email": "[email protected]",
33+
"first_name": "WorkOS",
34+
"last_name": "Demo",
35+
},
3136
}
3237

3338
@pytest.fixture
@@ -133,6 +138,11 @@ def test_get_profile_returns_expected_workosprofile_object(
133138
"connection_type": mock_profile["connection_type"],
134139
"last_name": mock_profile["last_name"],
135140
"idp_id": mock_profile["idp_id"],
141+
"raw_attributes": {
142+
"email": mock_profile["raw_attributes"]["email"],
143+
"first_name": mock_profile["raw_attributes"]["first_name"],
144+
"last_name": mock_profile["raw_attributes"]["last_name"],
145+
},
136146
},
137147
"access_token": "01DY34ACQTM3B1CSX1YSZ8Z00D",
138148
}

workos/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
__package_url__ = "https://github.com/workos-inc/workos-python"
1414

15-
__version__ = "0.4.2"
15+
__version__ = "0.5.0"
1616

1717
__author__ = "WorkOS"
1818

workos/resources/sso.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class WorkOSProfile(WorkOSBaseResource):
55
"""Representation of a User Profile as returned by WorkOS through the SSO feature.
6-
6+
77
Attributes:
88
OBJECT_FIELDS (list): List of fields a WorkOSProfile is comprised of.
99
"""
@@ -15,4 +15,5 @@ class WorkOSProfile(WorkOSBaseResource):
1515
"last_name",
1616
"connection_type",
1717
"idp_id",
18+
"raw_attributes",
1819
]

0 commit comments

Comments
 (0)