adonis, adonis-ally, entra
This driver extends Adonis Ally and allows to integrate Entra Sign In.
npm install ally-entra
#or
yarn add ally-entra
#or
pnpm add ally-entra
As the package has been installed, you have to configure it by running a command:
node ace configure ally-entra
Then open theenv.ts
file and paste the following code inside theEnv.rules
object.
ENTRA_CLIENT_ID:Env.schema.string(),
ENTRA_CLIENT_SECRET:Env.schema.string(),
ENTRA_TENANT_ID:Env.schema.string.optional(),
And don't forget to add these variables to your.env
and.env.example
files.
Configure the driver inside theconfig/ally.ts
file as follows
constallyConfig:AllyConfig={
//... other drivers
/*
|--------------------------------------------------------------------------
| Entra driver
|--------------------------------------------------------------------------
*/
entra:{
driver:'entra',
clientId:Env.get('ENTRA_CLIENT_ID'),
clientSecret:Env.get('ENTRA_CLIENT_SECRET'),
tenantId:Env.get('ENTRA_TENANT_ID'),
callbackUrl:'http://localhost:3333/entra/callback',
},
}
Entra Driver environment variables have some specific usage:
ENTRA_CLIENT_ID
- your app client idENTRE_CLIENT_SECRET
- your app private keyENTRA_TENANT_ID
- optional: your organization tenant id
For usage examples for Adonis Ally and its methods consult Adonis.jsofficial docs.