oauth-client-nestjs
This package includes client oauth authentication module based upon nest.
This package includes vcita authentication, and can also interact with additional providers.
Installation
install this package using npm in nest app.
You should add these env variables (you can add then on .env file):
- VCITA_CLIENT_ID
- VCITA_CLIENT_SECRET
- VCITA_AUTHORIZATION_CLIENT: client authorization url
- VCITA_APP_SERVER: vcita api server
- APPLICATION_URL
Usage
This is a dynamic module. To use it you should call register method:
OauthModule.register({ })
register configuration (all of then are optional)
- oauthConfig: a config object that includes oauth config for another provider, and target endpoint for vcita oauth - if different from 'vcita'
- logger: a logger for the app.
When using app db, the oauth package uses typeorm, so you should add some staff tou your config files:
- add this: "node_modules/@vcita/oauth-client-nestjs/**/.entity{.ts,.js}" to you entity array of typeorm config.
- (or:) add OauthData to entities array (db config file)
Then you need to generate migration, and run it.