File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ services:
103
103
profiles : ['', 'basyx', 'tests']
104
104
depends_on :
105
105
- mongodb
106
+ ports :
107
+ - ' 8081:8081'
106
108
environment :
107
109
# MongoDb configuration for Basyx Repository
108
110
BASYX__BACKEND : MongoDB
Original file line number Diff line number Diff line change
1
+ using Microsoft . Extensions . Configuration ;
2
+
3
+ namespace mnestix_proxy . Authentication
4
+ {
5
+ public static class ApplicationBuilderAuthExtensions
6
+ {
7
+ public static IApplicationBuilder UseMnestixConfiguredAuth ( this IApplicationBuilder app , IConfiguration configuration )
8
+ {
9
+ var openIdEnabled = configuration . GetSection ( "OpenId" ) . GetValue ( "EnableOpenIdAuth" , false ) ;
10
+ var azureAdEnabled = configuration . GetSection ( "AzureAd" ) . GetValue ( "EnableAzureAdAuth" , false ) ;
11
+
12
+ if ( openIdEnabled || azureAdEnabled ) {
13
+ app . UseAuthentication ( ) ;
14
+ app . UseAuthorization ( ) ;
15
+ }
16
+
17
+ return app ;
18
+ }
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -49,8 +49,9 @@ public static void Main(string[] args)
49
49
// pipeline settings
50
50
var app = builder . Build ( ) ;
51
51
52
- app . UseAuthentication ( ) ;
53
- app . UseAuthorization ( ) ;
52
+ app . UseMnestixConfiguredAuth ( builder . Configuration ) ;
53
+
54
+ app . UseCors ( "allowAnything" ) ;
54
55
55
56
app . MapReverseProxy ( proxyPipeline =>
56
57
{
Original file line number Diff line number Diff line change 22
22
},
23
23
// if both OpenId and AzureAd are enabled OpenId will be used
24
24
"OpenId" : {
25
- "EnableOpenIdAuth" : " true " ,
25
+ "EnableOpenIdAuth" : " false " ,
26
26
"Issuer" : " http://localhost:8080/realms/Menstix" ,
27
27
"ClientID" : " mnestixApi-demo" ,
28
28
"RequireHttpsMetadata" : " false"
39
39
"AuthorizationPolicy" : " customApiKeyToModifyValuesPolicy" ,
40
40
"Match" : {
41
41
"Path" : " api/{**catch-all}"
42
- }
42
+ }
43
43
},
44
44
"EnvironmentRoute" : {
45
45
"ClusterId" : " aasRepoCluster" ,
You can’t perform that action at this time.
0 commit comments