WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

JWT Validation in a custom HttpPlugin #407

@mjastrzebski-box

Description

@mjastrzebski-box

I am trying to use the SDK to build bots with a different approach to server. I do not want the application to manage the server, but rather the application to be managed within a server.
The difference is - in the SDK, the recommended approach is to start server along with the bot itself. In my approach, I create an endpoint and a controller and run the application's messageHandlers (JwtMiddleware + onRequest).

My approach assumed that the HttpPlugin could be reconstructed without any Express server elements. It is based on the docs: https://microsoft.github.io/teams-sdk/typescript/migrations/v1 that state that in case the user needs to use a different server, they have to create their own custom HttpPlugin.

Unfortunately - as withJwtValidation is not exported, I cannot reconstruct onInit.

const jwtMiddleware = withJwtValidation({

What is the recommended way of attaching the JWT Validation Middleware then? Shouldn't the withJwtValidation function be exported for such cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions