Skip to content

Commit 02cb13d

Browse files
wip
1 parent 3762101 commit 02cb13d

File tree

5 files changed

+439
-274
lines changed

5 files changed

+439
-274
lines changed
File renamed without changes.

BFF/v3/Websocket/Websocket.Bff/Program.cs renamed to BFF/v3/Websocket/Websocket.Bff/BffProgram.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
var builder = WebApplication.CreateBuilder(args);
77

8-
builder.Services.AddBff()
8+
builder.Services.AddBff(options => options.DisableAntiForgeryCheck = (c) => true)
99
.ConfigureOpenIdConnect(options =>
1010
{
1111
options.Authority = "https://demo.duendesoftware.com";
@@ -32,26 +32,30 @@
3232
})
3333
.AddRemoteApis();
3434

35-
// Add services to the container.
36-
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
37-
builder.Services.AddOpenApi();
3835

3936
var app = builder.Build();
4037

41-
// Configure the HTTP request pipeline.
42-
if (app.Environment.IsDevelopment())
43-
{
44-
app.MapOpenApi();
45-
}
46-
4738
app.UseHttpsRedirection();
4839

49-
app.UseWebSockets();
5040

51-
app.MapGet("/", () => "welcome");
41+
app.UseAuthentication();
42+
app.UseRouting();
43+
app.UseBff();
44+
45+
// adds authorization for local and remote API endpoints
46+
//app.UseAuthorization();
47+
//app.MapGet("/", () => "ok");
48+
49+
app.UseWebSockets();
5250

5351
app.MapRemoteBffApiEndpoint("/graphql", new Uri("http://localhost:5095/graphql"))
54-
.WithAccessToken(RequiredTokenType.Client);
52+
.WithAccessToken(RequiredTokenType.User);
53+
54+
//app.MapBffManagementEndpoints();
55+
56+
app.MapRemoteBffApiEndpoint("/", new Uri("http://localhost:5173"))
57+
.WithAccessToken(RequiredTokenType.None)
58+
.SkipAntiforgery();
5559

5660
app.Run();
5761

BFF/v3/Websocket/Websocket.Console/Program.cs renamed to BFF/v3/Websocket/Websocket.Console/ConsoleProgram.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace GraphQL.Client.Tests
66
{
7-
public class Program
7+
public class ConsoleProgram
88
{
99
/// <summary>
1010
/// This console application connects to a GraphQL WebSocket endpoint,

0 commit comments

Comments
 (0)