A Microsoft driver for AdonisJS Ally.
Install the package from your command line
npm install @tpointurier/ally-microsoft
Run the following command to configure the package:
node ace configure @tpointurier/ally-microsoft
Validate environment variables
MICROSOFT_CLIENT_ID: 'Env.schema.string()',
MICROSOFT_CLIENT_SECRET: 'Env.schema.string()',
MICROSOFT_CALLBACK_URL: 'Env.schema.string()',
MICROSOFT_TENANT_ID: 'Env.schema.string.optional()',
const allyConfig: AllyConfig = {
// ... other drivers
microsoft: microsoft({
clientId: env.get('MICROSOFT_CLIENT_ID'),
clientSecret: env.get('MICROSOFT_CLIENT_SECRET'),
callbackUrl: env.get('MICROSOFT_CALLBACK_URL'),
scopes: ['openid', 'profile', 'email'],
tenantId: env.get('MICROSOFT_TENANT_ID', 'common'),
}),
}
You can pass an array of scopes in your configuration, such as ['openid', 'profile', 'email']
. You can find a full list of scopes in the Microsoft Scopes Reference
Learn more about AdonisJS Ally in the documentation. You can also learn about the implementation in the ally-starter-kit repository.
Table of contents