@@ -35,9 +35,7 @@ public static class OpenIdConnectServerExtensions
35
35
/// <param name="builder">The authentication builder.</param>
36
36
/// <returns>The authentication builder.</returns>
37
37
public static AuthenticationBuilder AddOpenIdConnectServer ( [ NotNull ] this AuthenticationBuilder builder )
38
- {
39
- return builder . AddOpenIdConnectServer ( OpenIdConnectServerDefaults . AuthenticationScheme ) ;
40
- }
38
+ => builder . AddOpenIdConnectServer ( OpenIdConnectServerDefaults . AuthenticationScheme ) ;
41
39
42
40
/// <summary>
43
41
/// Adds a new OpenID Connect server instance in the ASP.NET Core pipeline.
@@ -51,9 +49,7 @@ public static AuthenticationBuilder AddOpenIdConnectServer([NotNull] this Authen
51
49
public static AuthenticationBuilder AddOpenIdConnectServer (
52
50
[ NotNull ] this AuthenticationBuilder builder ,
53
51
[ NotNull ] Action < OpenIdConnectServerOptions > configuration )
54
- {
55
- return builder . AddOpenIdConnectServer ( OpenIdConnectServerDefaults . AuthenticationScheme , configuration ) ;
56
- }
52
+ => builder . AddOpenIdConnectServer ( OpenIdConnectServerDefaults . AuthenticationScheme , configuration ) ;
57
53
58
54
/// <summary>
59
55
/// Adds a new OpenID Connect server instance in the ASP.NET Core pipeline.
@@ -64,9 +60,7 @@ public static AuthenticationBuilder AddOpenIdConnectServer(
64
60
[ EditorBrowsable ( EditorBrowsableState . Advanced ) ]
65
61
public static AuthenticationBuilder AddOpenIdConnectServer (
66
62
[ NotNull ] this AuthenticationBuilder builder , [ NotNull ] string scheme )
67
- {
68
- return builder . AddOpenIdConnectServer ( scheme , options => { } ) ;
69
- }
63
+ => builder . AddOpenIdConnectServer ( scheme , options => { } ) ;
70
64
71
65
/// <summary>
72
66
/// Adds a new OpenID Connect server instance in the ASP.NET Core pipeline.
@@ -155,6 +149,22 @@ public static IList<SigningCredentials> AddCertificate(
155
149
public static IList < SigningCredentials > AddCertificate (
156
150
[ NotNull ] this IList < SigningCredentials > credentials ,
157
151
[ NotNull ] Assembly assembly , [ NotNull ] string resource , [ NotNull ] string password )
152
+ => credentials . AddCertificate ( assembly , resource , password , X509KeyStorageFlags . MachineKeySet ) ;
153
+
154
+ /// <summary>
155
+ /// Adds a specific <see cref="X509Certificate2"/> retrieved from an
156
+ /// embedded resource to sign the tokens issued by the OpenID Connect server.
157
+ /// </summary>
158
+ /// <param name="credentials">The options used to configure the OpenID Connect server.</param>
159
+ /// <param name="assembly">The assembly containing the certificate.</param>
160
+ /// <param name="resource">The name of the embedded resource.</param>
161
+ /// <param name="password">The password used to open the certificate.</param>
162
+ /// <param name="flags">An enumeration of flags indicating how and where to store the private key of the certificate.</param>
163
+ /// <returns>The signing credentials.</returns>
164
+ public static IList < SigningCredentials > AddCertificate (
165
+ [ NotNull ] this IList < SigningCredentials > credentials ,
166
+ [ NotNull ] Assembly assembly , [ NotNull ] string resource ,
167
+ [ NotNull ] string password , X509KeyStorageFlags flags )
158
168
{
159
169
if ( credentials == null )
160
170
{
@@ -183,7 +193,7 @@ public static IList<SigningCredentials> AddCertificate(
183
193
throw new InvalidOperationException ( "The certificate was not found in the specified assembly." ) ;
184
194
}
185
195
186
- return credentials . AddCertificate ( stream , password ) ;
196
+ return credentials . AddCertificate ( stream , password , flags ) ;
187
197
}
188
198
}
189
199
@@ -198,9 +208,7 @@ public static IList<SigningCredentials> AddCertificate(
198
208
public static IList < SigningCredentials > AddCertificate (
199
209
[ NotNull ] this IList < SigningCredentials > credentials ,
200
210
[ NotNull ] Stream stream , [ NotNull ] string password )
201
- {
202
- return credentials . AddCertificate ( stream , password , X509KeyStorageFlags . MachineKeySet ) ;
203
- }
211
+ => credentials . AddCertificate ( stream , password , X509KeyStorageFlags . MachineKeySet ) ;
204
212
205
213
/// <summary>
206
214
/// Adds a specific <see cref="X509Certificate2"/> contained in
0 commit comments