The package has been configured successfully!
Make sure to first define the mapping inside the contracts/ally.ts
file as follows.
import { AAD, AADConfig } from 'adonis-ally-azure-ad/build/standalone'
declare module '@ioc:Adonis/Addons/Ally' {
interface SocialProviders {
// ... other mappings
AzureAD: {
config: AADConfig
implementation: AAD
}
}
}
const allyConfig: AllyConfig = {
// ... other configs
/*
|--------------------------------------------------------------------------
| AzureAD driver
|--------------------------------------------------------------------------
*/
AzureAD: {
driver: 'AzureAD',
authorizeUrl: Env.get('AAD_AUTHORIZE_ENDPOINT'), // Optional
userInfoUrl: Env.get('AAD_USER_ENDPOINT'), // Optional
accessTokenUrl: Env.get('AAD_TOKEN_ENDPOINT'), // Optional
clientId: Env.get('AAD_CLIENT_ID'),
clientSecret: Env.get('AAD_CLIENT_SECRET'),
callbackUrl: `http://localhost:${process.env.PORT}/azuread/callback`,
scopes: ['user.read', 'User.ReadBasic.All', 'openid', 'profile', 'email', 'offline_access'],
},
}