File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed
clients/src/ConsolePrivateKeyJwtClient
hosts/Shared/Configuration Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 57
57
}
58
58
""" ;
59
59
60
+ var hmacKey =
61
+ """
62
+ {
63
+ "kty":"oct",
64
+ "kid":"10909c7f-d6e0-49eb-9af9-fb06076df8e1",
65
+ "k":"JXhpjmgEVdhO0OzwyUQ2hCFuuSU9mABtclOcqT1kqaQ",
66
+ "alg":"HS256"
67
+ }
68
+ """ ;
69
+
60
70
// X.509 cert
61
71
var certificate = X509CertificateLoader . LoadPkcs12FromFile ( path : "client.p12" , password : "changeit" ) ;
62
72
var x509Credential = new X509SigningCredentials ( certificate ) ;
63
73
64
74
var response = await RequestTokenAsync ( x509Credential ) ;
65
75
response . Show ( ) ;
66
-
67
76
await CallServiceAsync ( response . AccessToken ) ;
68
77
69
78
// RSA JsonWebkey
70
79
var jwk = new JsonWebKey ( rsaKey ) ;
71
80
response = await RequestTokenAsync ( new SigningCredentials ( jwk , "RS256" ) ) ;
72
81
response . Show ( ) ;
82
+ await CallServiceAsync ( response . AccessToken ) ;
73
83
84
+ // EC JsonWebKey
85
+ jwk = new JsonWebKey ( hmacKey ) ;
86
+ response = await RequestTokenAsync ( new SigningCredentials ( jwk , "HS256" ) ) ;
87
+ response . Show ( ) ;
74
88
await CallServiceAsync ( response . AccessToken ) ;
75
89
76
90
// EC JsonWebKey
77
91
jwk = new JsonWebKey ( ecKey ) ;
78
92
response = await RequestTokenAsync ( new SigningCredentials ( jwk , "ES256" ) ) ;
79
93
response . Show ( ) ;
80
-
81
94
await CallServiceAsync ( response . AccessToken ) ;
82
95
83
96
// Graceful shutdown
Original file line number Diff line number Diff line change @@ -120,9 +120,9 @@ public static class ClientsConsole
120
120
Value =
121
121
"""
122
122
{
123
+ "kty":"RSA",
123
124
"e":"AQAB",
124
125
"kid":"ZzAjSnraU3bkWGnnAqLapYGpTyNfLbjbzgAPbbW2GEA",
125
- "kty":"RSA",
126
126
"n":"wWwQFtSzeRjjerpEM5Rmqz_DsNaZ9S1Bw6UbZkDLowuuTCjBWUax0vBMMxdy6XjEEK4Oq9lKMvx9JzjmeJf1knoqSNrox3Ka0rnxXpNAz6sATvme8p9mTXyp0cX4lF4U2J54xa2_S9NF5QWvpXvBeC4GAJx7QaSw4zrUkrc6XyaAiFnLhQEwKJCwUw4NOqIuYvYp_IXhw-5Ti_icDlZS-282PcccnBeOcX7vc21pozibIdmZJKqXNsL1Ibx5Nkx1F1jLnekJAmdaACDjYRLL_6n3W4wUp19UvzB1lGtXcJKLLkqB6YDiZNu16OSiSprfmrRXvYmvD8m6Fnl5aetgKw"
127
127
}
128
128
"""
@@ -141,6 +141,19 @@ public static class ClientsConsole
141
141
"kid":"1"
142
142
}
143
143
"""
144
+ } ,
145
+ new Secret
146
+ {
147
+ Type = IdentityServerConstants . SecretTypes . JsonWebKey ,
148
+ Value =
149
+ """
150
+ {
151
+ "kty":"oct",
152
+ "kid":"10909c7f-d6e0-49eb-9af9-fb06076df8e1",
153
+ "k":"JXhpjmgEVdhO0OzwyUQ2hCFuuSU9mABtclOcqT1kqaQ",
154
+ "alg":"HS256"
155
+ }
156
+ """
144
157
}
145
158
} ,
146
159
AllowedGrantTypes = GrantTypes . ClientCredentials ,
You can’t perform that action at this time.
0 commit comments