File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 88
99var tenantId = Environment . GetEnvironmentVariable ( "TW_ENTRA_TENANT_ID" ) ?? "" ;
1010var audience = Environment . GetEnvironmentVariable ( "TW_ENTRA_AUDIENCE" ) ?? "" ;
11+ var clientId = Environment . GetEnvironmentVariable ( "TW_ENTRA_CLIENT_ID" ) ?? "" ;
1112var mcpResource = Environment . GetEnvironmentVariable ( "TW_MCP_RESOURCE" ) ?? "" ;
1213
1314if ( string . IsNullOrWhiteSpace ( tenantId ) )
1617if ( string . IsNullOrWhiteSpace ( audience ) )
1718 throw new InvalidOperationException ( "TW_ENTRA_AUDIENCE must be set to a valid Entra audience." ) ;
1819
20+ if ( string . IsNullOrWhiteSpace ( clientId ) )
21+ throw new InvalidOperationException ( "TW_ENTRA_CLIENT_ID must be set to the Entra app registration's client ID." ) ;
22+
1923if ( string . IsNullOrWhiteSpace ( mcpResource ) )
2024 throw new InvalidOperationException ( "TW_MCP_RESOURCE must be set to the canonical URL of this MCP server (e.g. https://mcp.example.com)." ) ;
2125
4650 ValidateAudience = true ,
4751 ValidateLifetime = true ,
4852 ValidateIssuerSigningKey = true ,
49- ValidAudience = audience ,
53+ ValidAudiences = new [ ] { audience , clientId } ,
5054 ValidIssuer = authority ,
5155 } ;
5256} )
You can’t perform that action at this time.
0 commit comments