File tree Expand file tree Collapse file tree 5 files changed +439
-274
lines changed Expand file tree Collapse file tree 5 files changed +439
-274
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 5
5
6
6
var builder = WebApplication . CreateBuilder ( args ) ;
7
7
8
- builder . Services . AddBff ( )
8
+ builder . Services . AddBff ( options => options . DisableAntiForgeryCheck = ( c ) => true )
9
9
. ConfigureOpenIdConnect ( options =>
10
10
{
11
11
options . Authority = "https://demo.duendesoftware.com" ;
32
32
} )
33
33
. AddRemoteApis ( ) ;
34
34
35
- // Add services to the container.
36
- // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
37
- builder . Services . AddOpenApi ( ) ;
38
35
39
36
var app = builder . Build ( ) ;
40
37
41
- // Configure the HTTP request pipeline.
42
- if ( app . Environment . IsDevelopment ( ) )
43
- {
44
- app . MapOpenApi ( ) ;
45
- }
46
-
47
38
app . UseHttpsRedirection ( ) ;
48
39
49
- app . UseWebSockets ( ) ;
50
40
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 ( ) ;
52
50
53
51
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 ( ) ;
55
59
56
60
app . Run ( ) ;
57
61
Original file line number Diff line number Diff line change 4
4
5
5
namespace GraphQL . Client . Tests
6
6
{
7
- public class Program
7
+ public class ConsoleProgram
8
8
{
9
9
/// <summary>
10
10
/// This console application connects to a GraphQL WebSocket endpoint,
You can’t perform that action at this time.
0 commit comments