Skip to content

Commit 9a91bbd

Browse files
authored
Merge pull request #298 from DuendeSoftware/ev/samples/bff-use-auth
remove .UseAuthentication(options => ...) and make sure yarp sample works
2 parents 9ce9dd7 + cf94a72 commit 9a91bbd

7 files changed

Lines changed: 1 addition & 43 deletions

File tree

BFF/v4/BlazorAutoRendering/BlazorAutoRendering/Program.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
.AddInteractiveServerComponents()
1717
.AddInteractiveWebAssemblyComponents();
1818

19-
builder.Services.AddAuthentication(options =>
20-
{
21-
options.DefaultScheme = BffAuthenticationSchemes.BffCookie;
22-
options.DefaultChallengeScheme = BffAuthenticationSchemes.BffOpenIdConnect;
23-
});
24-
2519
// BFF setup for blazor
2620
builder.Services.AddBff()
2721
.AddServerSideSessions() // Add in-memory implementation of server side sessions

BFF/v4/JsBffYarpSample/FrontendHost/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
options.Cookie.SameSite = SameSiteMode.Strict;
4343
});
4444

45-
var yarpBuilder = builder.Services.AddReverseProxy();
45+
var yarpBuilder = builder.Services.AddReverseProxy().AddBffExtensions();
4646
//Configure from included extension method
4747
yarpBuilder.Configure();
4848

BFF/v4/Quickstarts/BlazorBffApp/BlazorBffApp/Program.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@
5252

5353
//builder.Services.AddHttpClient<WeatherHttpClient>(opt => opt.BaseAddress = new Uri("https://localhost:7007"));
5454

55-
// Configure the authentication
56-
builder.Services.AddAuthentication(options =>
57-
{
58-
options.DefaultScheme = BffAuthenticationSchemes.BffCookie;
59-
options.DefaultChallengeScheme = BffAuthenticationSchemes.BffOpenIdConnect;
60-
options.DefaultSignOutScheme = BffAuthenticationSchemes.BffOpenIdConnect;
61-
});
62-
6355
// Make sure authentication state is available to all components.
6456
builder.Services.AddCascadingAuthenticationState();
6557

BFF/v4/React/React.Bff/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
options.Cookie.SameSite = SameSiteMode.Strict;
4242
});
4343

44-
builder.Services.AddAuthentication(options =>
45-
{
46-
options.DefaultScheme = BffAuthenticationSchemes.BffCookie;
47-
options.DefaultChallengeScheme = BffAuthenticationSchemes.BffOpenIdConnect;
48-
options.DefaultSignOutScheme = BffAuthenticationSchemes.BffOpenIdConnect;
49-
});
50-
5144
builder.Services.AddAuthorization();
5245

5346
var app = builder.Build();

BFF/v4/SplitHosts/BackendHost/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@
6363
client.BaseAddress = new Uri("https://localhost:5002/");
6464
});
6565

66-
builder.Services.AddAuthentication(options =>
67-
{
68-
options.DefaultScheme = BffAuthenticationSchemes.BffCookie;
69-
options.DefaultChallengeScheme = BffAuthenticationSchemes.BffOpenIdConnect;
70-
options.DefaultSignOutScheme = BffAuthenticationSchemes.BffOpenIdConnect;
71-
});
72-
7366
var app = builder.Build();
7467

7568
app.UseDefaultFiles();

BFF/v4/Vue/Vue.Bff/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@
3737
options.Cookie.SameSite = SameSiteMode.Strict;
3838
});
3939

40-
builder.Services.AddAuthentication(options =>
41-
{
42-
options.DefaultScheme = BffAuthenticationSchemes.BffCookie;
43-
options.DefaultChallengeScheme = BffAuthenticationSchemes.BffOpenIdConnect;
44-
options.DefaultSignOutScheme = BffAuthenticationSchemes.BffOpenIdConnect;
45-
});
46-
4740
builder.Services.AddAuthorization();
4841

4942
var app = builder.Build();

BFF/v4/docker/FrontendHost/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@
7575
options.Cookie.SameSite = SameSiteMode.Strict;
7676
});
7777

78-
builder.Services.AddAuthentication(options =>
79-
{
80-
options.DefaultScheme = BffAuthenticationSchemes.BffCookie;
81-
options.DefaultChallengeScheme = BffAuthenticationSchemes.BffOpenIdConnect;
82-
options.DefaultSignOutScheme = BffAuthenticationSchemes.BffOpenIdConnect;
83-
});
84-
8578
builder.Services.AddUserAccessTokenHttpClient("api_client", configureClient: client =>
8679
{
8780
client.BaseAddress = new Uri("https://localhost:5002/");

0 commit comments

Comments
 (0)