An example of using nestjs to connect CAS (Central Authentication Service). Using connect-cas underlying.
- Clone:
git clone https://github.com/fralonra/nestjs-cas-example
- Install:
cd nestjs-cas-example && yarn
- If you wish to use the existing fake CAS server, please run
yarn cas:prod
. Or you can specify your CAS server settings inconfig/default.ts
.
// config/default.ts
const casHost = '127.0.0.1';
const casPort = 8989;
export default {
// ...
cas: {
protocol: 'http',
host: `${casHost}:${casPort}`,
paths: {
serviceValidate: 'p3/serviceValidate',
login: 'login',
logout: 'logout',
}
}
};
- Run the CAS client:
yarn app:dev
, and now you can openhttp://localhost:3434
(by default) to see the example.