@@ -67,7 +67,6 @@ public async Task Valid_client_should_succeed()
67
67
{
68
68
Address = TokenEndpoint ,
69
69
70
- ClientId = ClientId ,
71
70
ClientAssertion =
72
71
{
73
72
Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
@@ -88,8 +87,6 @@ public async Task Valid_client_with_implicit_clientId_should_succeed()
88
87
var response = await _client . RequestClientCredentialsTokenAsync ( new ClientCredentialsTokenRequest
89
88
{
90
89
Address = TokenEndpoint ,
91
- ClientId = "client" ,
92
-
93
90
ClientAssertion =
94
91
{
95
92
Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
@@ -101,7 +98,7 @@ public async Task Valid_client_with_implicit_clientId_should_succeed()
101
98
102
99
AssertValidToken ( response ) ;
103
100
}
104
-
101
+
105
102
[ Fact ]
106
103
public async Task Valid_client_with_token_replay_should_fail ( )
107
104
{
@@ -110,8 +107,6 @@ public async Task Valid_client_with_token_replay_should_fail()
110
107
var response = await _client . RequestClientCredentialsTokenAsync ( new ClientCredentialsTokenRequest
111
108
{
112
109
Address = TokenEndpoint ,
113
-
114
- ClientId = ClientId ,
115
110
ClientAssertion =
116
111
{
117
112
Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
@@ -122,13 +117,11 @@ public async Task Valid_client_with_token_replay_should_fail()
122
117
} ) ;
123
118
124
119
AssertValidToken ( response ) ;
125
-
120
+
126
121
// replay
127
122
response = await _client . RequestClientCredentialsTokenAsync ( new ClientCredentialsTokenRequest
128
123
{
129
124
Address = TokenEndpoint ,
130
-
131
- ClientId = ClientId ,
132
125
ClientAssertion =
133
126
{
134
127
Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
@@ -148,11 +141,9 @@ public async Task Client_with_invalid_secret_should_fail()
148
141
var response = await _client . RequestClientCredentialsTokenAsync ( new ClientCredentialsTokenRequest
149
142
{
150
143
Address = TokenEndpoint ,
151
-
152
- ClientId = ClientId ,
153
144
ClientAssertion =
154
145
{
155
- Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
146
+ Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
156
147
Value = "invalid"
157
148
} ,
158
149
@@ -173,8 +164,6 @@ public async Task Invalid_client_should_fail()
173
164
var response = await _client . RequestClientCredentialsTokenAsync ( new ClientCredentialsTokenRequest
174
165
{
175
166
Address = TokenEndpoint ,
176
-
177
- ClientId = clientId ,
178
167
ClientAssertion =
179
168
{
180
169
Type = OidcConstants . ClientAssertionTypes . JwtBearer ,
@@ -204,12 +193,12 @@ private void AssertValidToken(TokenResponse response)
204
193
response . RefreshToken . Should ( ) . BeNull ( ) ;
205
194
206
195
var payload = GetPayload ( response ) ;
207
-
196
+
208
197
payload . Count ( ) . Should ( ) . Be ( 8 ) ;
209
198
payload . Should ( ) . Contain ( "iss" , "https://idsvr4" ) ;
210
199
payload . Should ( ) . Contain ( "client_id" , ClientId ) ;
211
200
payload . Keys . Should ( ) . Contain ( "iat" ) ;
212
-
201
+
213
202
var scopes = payload [ "scope" ] as JArray ;
214
203
scopes . First ( ) . ToString ( ) . Should ( ) . Be ( "api1" ) ;
215
204
0 commit comments