File tree 4 files changed +12
-4
lines changed
BlazorWebAppEntra/BlazorWebAppEntra
BlazorWebAppEntraBff/BlazorWebAppEntra
BlazorWebAppOidc/BlazorWebAppOidc
BlazorWebAppOidcBff/BlazorWebAppOidc
4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 8
8
var builder = WebApplication . CreateBuilder ( args ) ;
9
9
10
10
// Add services to the container.
11
+ // Remove or set 'SerializeAllClaims' to 'false' if you only want to
12
+ // serialize name and role claims for CSR.
11
13
builder . Services . AddRazorComponents ( )
12
14
. AddInteractiveServerComponents ( )
13
15
. AddInteractiveWebAssemblyComponents ( )
14
- . AddAuthenticationStateSerialization ( ) ;
16
+ . AddAuthenticationStateSerialization ( options => options . SerializeAllClaims = true ) ;
15
17
16
18
builder . Services . AddAuthentication ( OpenIdConnectDefaults . AuthenticationScheme )
17
19
. AddMicrosoftIdentityWebApp ( builder . Configuration . GetSection ( "AzureAd" ) )
Original file line number Diff line number Diff line change 27
27
28
28
builder . Services . AddCascadingAuthenticationState ( ) ;
29
29
30
+ // Remove or set 'SerializeAllClaims' to 'false' if you only want to
31
+ // serialize name and role claims for CSR.
30
32
builder . Services . AddRazorComponents ( )
31
33
. AddInteractiveServerComponents ( )
32
34
. AddMicrosoftIdentityConsentHandler ( )
33
35
. AddInteractiveWebAssemblyComponents ( )
34
- . AddAuthenticationStateSerialization ( ) ;
36
+ . AddAuthenticationStateSerialization ( options => options . SerializeAllClaims = true ) ;
35
37
36
38
builder . Services . AddHttpForwarderWithServiceDiscovery ( ) ;
37
39
builder . Services . AddHttpContextAccessor ( ) ;
Original file line number Diff line number Diff line change 149
149
150
150
builder . Services . AddCascadingAuthenticationState ( ) ;
151
151
152
+ // Remove or set 'SerializeAllClaims' to 'false' if you only want to
153
+ // serialize name and role claims for CSR.
152
154
builder . Services . AddRazorComponents ( )
153
155
. AddInteractiveServerComponents ( )
154
156
. AddInteractiveWebAssemblyComponents ( )
155
- . AddAuthenticationStateSerialization ( ) ;
157
+ . AddAuthenticationStateSerialization ( options => options . SerializeAllClaims = true ) ;
156
158
157
159
builder . Services . AddScoped < IWeatherForecaster , ServerWeatherForecaster > ( ) ;
158
160
Original file line number Diff line number Diff line change 154
154
155
155
builder . Services . AddCascadingAuthenticationState ( ) ;
156
156
157
+ // Remove or set 'SerializeAllClaims' to 'false' if you only want to
158
+ // serialize name and role claims for CSR.
157
159
builder . Services . AddRazorComponents ( )
158
160
. AddInteractiveServerComponents ( )
159
161
. AddInteractiveWebAssemblyComponents ( )
160
- . AddAuthenticationStateSerialization ( ) ;
162
+ . AddAuthenticationStateSerialization ( options => options . SerializeAllClaims = true ) ;
161
163
162
164
builder . Services . AddHttpForwarderWithServiceDiscovery ( ) ;
163
165
builder . Services . AddHttpContextAccessor ( ) ;
You can’t perform that action at this time.
0 commit comments