@overture-stack/ego-token-middleware
    TypeScript icon, indicating that this package has built-in type declarations

    2.3.0 • Public • Published

    ego-token-middleware

    Express middleware for validating ego JWT

    Slack

    Usage

    import Auth from 'ego-token-middleware';
    const app = express();
    ...
    ِconst authFilter = Auth(jwtKeyUrl)(WRITE_SCOPE)
    app.get('/protected', authFilter, (req: Request, res: Response) => {
      return res.send('I am protected');
    });
    

    The Ego JWT must be included in in the request as authorization in either the body or the header, with the format "Bearer __TOKEN__" where __TOKEN__ is the token.

    This middleware needs the request to be ran through body-parser by the consuming app.

    publishing

    A github action is setup to run tests and auto publish to npm registery if the version in package.json is new when a push to master happens

    Keywords

    none

    Install

    npm i @overture-stack/ego-token-middleware

    DownloadsWeekly Downloads

    7

    Version

    2.3.0

    License

    ISC

    Unpacked Size

    27.5 kB

    Total Files

    20

    Last publish

    Collaborators

    • overturebio
    • hlminh2000
    • andricdu
    • joneubank
    • ciaranschutte
    • caravinci
    • ballabadi