Skip to content

Commit

Permalink
Merge pull request #2161 from josephweinkam/release/R3.2.0
Browse files Browse the repository at this point in the history
Update oauth server BcscTestUser claims to include userInfo
  • Loading branch information
josephweinkamgov authored May 15, 2024
2 parents d02eac6 + 1508a3e commit 73a3649
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oauth-server/src/API/OAuthServer/Data/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
]
},
{
"ClientId": "test-client",
"ClientId": "dev-test-client",
"ClientSecrets": [
{
"Value": "EjuRF+sIxWuqxAgN+XgG157CmIANcfYcpv09mI2dg70="
Expand Down
19 changes: 19 additions & 0 deletions oauth-server/src/API/OAuthServer/Data/test_users.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,24 @@
"given_name": "BCSC",
"display_name": "BCSC TEST",
"family_name": "TEST"
},
{
"sub": "EVAC-1-0",
"userName": "EVAC-1-0",
"password": "autotest-1-0",
"aud": "bcsc.aud",
"birthdate": "1926-09-13",
"address": {
"street_address": "159 Smith Valley Suite 378",
"country": "CA",
"formatted": "159 Smith Valley Suite 378\nFraser Valley, BC V6R6V6",
"locality": "Fraser Valley",
"region": "BC",
"postal_code": "V6R6V6"
},
"iss": "https://idtest.gov.bc.ca/oauth2/",
"given_name": "autotest-EVAC",
"display_name": "autotest-EVAC 1-0",
"family_name": "1-0"
}
]
19 changes: 19 additions & 0 deletions oauth-server/src/API/OAuthServer/TestUsers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class BcscTestUser
public string family_name { get; set; }

public Claim[] Claims => new[] {
new Claim("userInfo", JsonConvert.SerializeObject(new BcscTestUserInfo(this))),
new Claim("display_name", display_name),
new Claim(JwtClaimTypes.GivenName, given_name),
new Claim(JwtClaimTypes.FamilyName, family_name),
Expand All @@ -85,6 +86,24 @@ public class BcscTestUser
};
}

public class BcscTestUserInfo
{
public BcscTestUserAddress address { get; set; }
public string birthdate { get; set; }
public string given_name { get; set; }
public string display_name { get; set; }
public string family_name { get; set; }

public BcscTestUserInfo(BcscTestUser user)
{
this.address = user.address;
this.birthdate = user.birthdate;
this.given_name = user.given_name;
this.display_name = user.display_name;
this.family_name = user.family_name;
}
}

public class BcscTestUserAddress
{
public string street_address { get; set; }
Expand Down

0 comments on commit 73a3649

Please sign in to comment.