1.3.2 • Published 6 years ago

@foundry-ai/api-auth v1.3.2

Weekly downloads
61
License
MIT
Repository
github
Last release
6 years ago

Foundry.ai Api Auth

This module exposes connect middleware for Foundry.ai APIs to authenticate requests.

npm install --save @foundry-ai/api-auth

Basic Usage

const apiAuth = require('@foundry-ai/api-auth');
const app = require('express');

app.use(apiAuth({
  authEndpoint: 'https://auth.myapp.com/v1/oauth2/authorization'
}));

Access Data

If authorization is successful any data returned from your auth endpoint will be attached to the request and made available via req.auth

app.use(apiAuth({
  authEndpoint: 'https://auth.myapp.com/v1/oauth2/authorization'
}));

app.get('/test', (req, res, next) => {
  console.log(req.auth)
  // { 
  //   userId: 'dfce809c-9245-551d-9312-ed3551e6bebb', 
  //   scope: '*' 
  // }
})
1.3.2

6 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago