@@ -74,17 +74,17 @@ string environmentName
7474 } ) ;
7575 }
7676
77- services . AddOpenIddict ( )
78- // Register the OpenIddict core components.
77+ services . AddOpenIddict ( )
78+ // Register the OpenIddict core components.
7979 . AddCore ( options =>
8080 {
8181 options . UseEntityFrameworkCore ( ) ;
8282 if ( ! Helpers . Constants . IsTestingEnvironment ( environmentName ) )
8383 {
8484 options . UseQuartz ( ) ;
8585 }
86- } )
87- // Register the OpenIddict server components.
86+ } )
87+ // Register the OpenIddict server components.
8888 . AddServer ( options =>
8989 {
9090 options . SetIssuer ( new Uri ( "https://localhost:5001/" ) ) ;
@@ -99,7 +99,8 @@ string environmentName
9999 // Note: this sample uses the code, device, password and refresh token flows, but you
100100 // can enable the other flows if you need to support implicit or client credentials.
101101 options . AllowAuthorizationCodeFlow ( )
102- . AllowRefreshTokenFlow ( ) ;
102+ . AllowRefreshTokenFlow ( )
103+ . AllowClientCredentialsFlow ( ) ;
103104
104105 // Mark the "email", "profile", "roles" and "demo_api" scopes as supported scopes.
105106 options . RegisterScopes (
@@ -139,17 +140,17 @@ string environmentName
139140 {
140141 options . DisableAccessTokenEncryption ( ) ;
141142 }
142- } )
143- // Register the OpenIddict validation components.
143+ } )
144+ // Register the OpenIddict validation components.
144145 . AddValidation ( options =>
145146 {
146147 // Import the configuration from the local OpenIddict server instance.
147148 options . UseLocalServer ( ) ;
148149
149150 // Register the ASP.NET Core host.
150151 options . UseAspNetCore ( ) ;
151- } )
152- // Register the EF based UI Store for OpenIddict related entities.
152+ } )
153+ // Register the EF based UI Store for OpenIddict related entities.
153154 . AddUIStore ( options =>
154155 {
155156 options . OpenIddictUIContext = builder =>
@@ -164,8 +165,8 @@ string environmentName
164165 . Name ) ;
165166 } ) ;
166167 } ;
167- } )
168- // Register the APIs for the EF based UI Store based on OpenIddict.
168+ } )
169+ // Register the APIs for the EF based UI Store based on OpenIddict.
169170 . AddUIApis ( options =>
170171 {
171172 // Tell the system about the allowed Permissions it is built/configured for.
@@ -178,15 +179,16 @@ string environmentName
178179 Permissions . GrantTypes . AuthorizationCode ,
179180 Permissions . GrantTypes . DeviceCode ,
180181 Permissions . GrantTypes . RefreshToken ,
182+ Permissions . GrantTypes . ClientCredentials ,
181183 Permissions . ResponseTypes . Code ,
182184 Permissions . Scopes . Email ,
183185 Permissions . Scopes . Profile ,
184186 Permissions . Scopes . Roles ,
185187 Permissions . Prefixes . Scope + "server_scope" ,
186188 Permissions . Prefixes . Scope + "api_scope"
187189 ] ;
188- } )
189- // Register the EF based UI Store for the ASP.NET Identity related entities.
190+ } )
191+ // Register the EF based UI Store for the ASP.NET Identity related entities.
190192 . AddUIIdentityStore < ApplicationUser > ( options =>
191193 {
192194 options . OpenIddictUIIdentityContext = builder =>
@@ -201,8 +203,8 @@ string environmentName
201203 . Name ) ;
202204 } ) ;
203205 } ;
204- } )
205- // Register the APIs for the EF based UI Store based on ASP.NET Identity.
206+ } )
207+ // Register the APIs for the EF based UI Store based on ASP.NET Identity.
206208 . AddUIIdentityApis < ApplicationUser > ( ) ;
207209
208210 if ( ! Helpers . Constants . IsTestingEnvironment ( environmentName ) )
0 commit comments