Skip to content

Commit

Permalink
Add groups attribute to SSO user profile (#117)
Browse files Browse the repository at this point in the history
* Add groups attribute to SSO user profile

* Change array to list
  • Loading branch information
blairlunceford authored Mar 7, 2023
1 parent d969fa7 commit 2f1dbd2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/WorkOS.net/Services/SSO/Entities/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public class Profile
[JsonProperty("last_name")]
public string LastName { get; set; }

/// <summary>
/// The user's groups.
/// </summary>
[JsonProperty("groups")]
public List<string> Groups { get; set; }

/// <summary>
/// The raw response of Profile attributes from the identity provider.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions test/WorkOSTests/Services/SSO/SSOServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ public async void TestGetProfileAndToken()
Email = "rick@sanchez.com",
FirstName = "Rick",
LastName = "Sanchez",
Groups = new List<string>()
{
"Admins",
"Developers",
},
RawAttributes = new Dictionary<string, object>()
{
{ "idp_id", "123" },
Expand Down Expand Up @@ -253,6 +258,11 @@ public async void TestGetProfile()
Email = "rick@sanchez.com",
FirstName = "Rick",
LastName = "Sanchez",
Groups = new List<string>()
{
"Admins",
"Developers",
},
RawAttributes = new Dictionary<string, object>()
{
{ "idp_id", "123" },
Expand Down

0 comments on commit 2f1dbd2

Please sign in to comment.