File tree Expand file tree Collapse file tree
src/Scim/SimpleIdServer.Scim.ApiKeyAuth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,21 +11,14 @@ public static class ScimBuilderExtensions
1111{
1212 public static ScimBuilder EnableApiKeyAuth ( this ScimBuilder builder , ApiKeysConfiguration ? apiKeysConfiguration = null )
1313 {
14- if ( apiKeysConfiguration != null )
15- {
16- builder . Services . AddSingleton ( ApiKeysConfiguration . Default ) ;
17- }
18- else
19- {
20- builder . Services . AddSingleton ( apiKeysConfiguration ) ;
21- }
14+ builder . Services . AddSingleton ( apiKeysConfiguration ?? ApiKeysConfiguration . Default ) ;
2215
2316 builder . Services . AddAuthentication ( ApiKeyDefaults . AuthenticationScheme )
24- . AddApiKeyInHeaderOrQueryParams < ApiKeyProvider > ( options =>
25- {
26- options . Realm = "Sample Web API" ;
27- options . KeyName = "Authorization" ;
28- } ) ;
17+ . AddApiKeyInHeaderOrQueryParams < ApiKeyProvider > ( options =>
18+ {
19+ options . Realm = "Sample Web API" ;
20+ options . KeyName = "Authorization" ;
21+ } ) ;
2922 builder . Services . AddAuthorization ( opts => opts . AddDefaultSCIMAuthorizationPolicy ( ) ) ;
3023 return builder ;
3124 }
You can’t perform that action at this time.
0 commit comments