File tree Expand file tree Collapse file tree 5 files changed +6
-3
lines changed
express-mcp-vet-ai-assist-app/src Expand file tree Collapse file tree 5 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const port = process.env.PORT || 3000;
1111
1212const mcpAuthServer = new McpAuthServer ( {
1313 baseUrl : process . env . BASE_URL as string ,
14+ issuer : process . env . ISSUER as string ,
1415} ) ;
1516
1617app . use ( express . json ( ) ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const app: Express = express();
3131
3232const mcpAuthServer : McpAuthServer = new McpAuthServer ( {
3333 baseUrl : process . env . BASE_URL as string ,
34+ issuer : process . env . ISSUER as string ,
3435} ) ;
3536
3637app . use ( express . json ( ) ) ;
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export default function bearerAuthMiddleware(options: McpAuthOptions) {
6060 options : {
6161 audience : options ?. audience ,
6262 clockTolerance : 60 ,
63- issuer : `${ issuerBase } /oauth2/token ` ,
63+ issuer : `${ options . issuer } ` ,
6464 } ,
6565 } ;
6666
Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ import {getProtectedResourceMetadata} from '../controllers/protected-resource';
2323
2424export default function AuthRouter ( options : McpAuthOptions ) : express . Router {
2525 const router : express . Router = express . Router ( ) ;
26- const { baseUrl} = options ;
26+ const { baseUrl, issuer } = options ;
2727 if ( ! baseUrl ) {
2828 throw new Error ( 'baseUrl must be provided' ) ;
2929 }
3030
3131 router . use (
3232 PROTECTED_RESOURCE_URL ,
3333 getProtectedResourceMetadata ( {
34- authorizationServers : [ baseUrl ] ,
34+ authorizationServers : [ issuer ] ,
3535 resource : 'https://api.example.com' ,
3636 } ) ,
3737 ) ;
Original file line number Diff line number Diff line change 1919export interface McpAuthOptions {
2020 audience ?: string ;
2121 baseUrl : string ;
22+ issuer : string ;
2223}
You can’t perform that action at this time.
0 commit comments