-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,44 @@ namespace Abblix.Oidc.Server.UnitTests.Model; | |
|
||
public class ClientRegistrationRequestTest | ||
{ | ||
[Theory] | ||
[InlineData( | ||
"{\"client_name\":\"dynamic_client_1 RqxLk9BdhK8qC3z\",\"grant_types\":[\"implicit\"],\"jwks\":{\"keys\":[{\"kty\":\"RSA\",\"e\":\"AQAB\",\"use\":\"sig\",\"alg\":\"RS256\",\"n\":\"gUOdYo2PpUUnZzozIPJ-7mK2Z5jYBxjj_5iB2TDnElt8yUc-mcCeOQrsaswPgKx2KMSJ50kwrFHHEuNyiDhgNMgtmJ98RuhggXaPF1fmmHss_Wc1OSqyGYLWbEzYGsRck5yTVP4xsPYAeP5xkkLze_FXJvwITNu2aGxXEYwokkrcWgL3AsXtYKClIwmacHhVNEMn-ALe3sMTifx4F8TqmNAlD4FPga094txHJNo2Ho6z4kn5L4uq_WXklDjaIDOqQZtdn0emXig3RHQcOtepFcXt7pcK9E2M3kxKFOMPpY8c4kaDfQ41jv23vbm9oDTh5s3TB0ZwcKJXj4-06gwTWw\"}]},\"token_endpoint_auth_method\":\"client_secret_basic\",\"response_types\":[\"id_token token\"],\"redirect_uris\":[\"https://www.certification.openid.net/test/a/Abblix/callback\"],\"contacts\":[\"[email protected]\"]}")] | ||
public void DeserializeClientRegistrationRequestTest(string json) | ||
[Fact] | ||
public void DeserializeClientRegistrationRequestTest() | ||
{ | ||
JsonSerializer.Deserialize<ClientRegistrationRequest>(json); | ||
const string json = | ||
""" | ||
{ | ||
"client_name": "dynamic_client_1 RqxLk9BdhK8qC3z", | ||
"grant_types": [ | ||
"implicit" | ||
], | ||
"jwks": { | ||
"keys": [ | ||
{ | ||
"kty": "RSA", | ||
"e": "AQAB", | ||
"use": "sig", | ||
"alg": "RS256", | ||
"n": "gUOdYo2PpUUnZzozIPJ-7mK2Z5jYBxjj_5iB2TDnElt8yUc-mcCeOQrsaswPgKx2KMSJ50kwrFHHEuNyiDhgNMgtmJ98RuhggXaPF1fmmHss_Wc1OSqyGYLWbEzYGsRck5yTVP4xsPYAeP5xkkLze_FXJvwITNu2aGxXEYwokkrcWgL3AsXtYKClIwmacHhVNEMn-ALe3sMTifx4F8TqmNAlD4FPga094txHJNo2Ho6z4kn5L4uq_WXklDjaIDOqQZtdn0emXig3RHQcOtepFcXt7pcK9E2M3kxKFOMPpY8c4kaDfQ41jv23vbm9oDTh5s3TB0ZwcKJXj4-06gwTWw" | ||
} | ||
] | ||
}, | ||
"token_endpoint_auth_method": "client_secret_basic", | ||
"response_types": [ | ||
"id_token token" | ||
], | ||
"redirect_uris": [ | ||
"https://www.certification.openid.net/test/a/Abblix/callback" | ||
], | ||
"contacts": [ | ||
"[email protected]" | ||
] | ||
} | ||
"""; | ||
var req = JsonSerializer.Deserialize<ClientRegistrationRequest>(json); | ||
Assert.NotNull(req); | ||
Assert.Equal("dynamic_client_1 RqxLk9BdhK8qC3z", req.ClientName); | ||
Assert.Equal(["implicit"], req.GrantTypes); | ||
Assert.Equal([["id_token", "token"]], req.ResponseTypes); | ||
Assert.Equal(["[email protected]"], req.Contacts); | ||
} | ||
} |