Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAD & AADConfig #7

Open
florianchevallier opened this issue Sep 19, 2022 · 3 comments
Open

AAD & AADConfig #7

florianchevallier opened this issue Sep 19, 2022 · 3 comments

Comments

@florianchevallier
Copy link

florianchevallier commented Sep 19, 2022

Hey !

Thank you for this package.

I'm trying to use it but I'm struggling with the integration :

import { AAD, AADConfig } from 'adonis-ally-azure-ad/build/standalone'

image

Cause, indeed, the build folder doesn't exist and I don't have any access to any type.

Could you help me on that ?

To give you more insight, here are the commands I launched :

yarn create adonis-ts-app azure-ad # here I chose "api" type
cd azure-ad
npm i @adonisjs/ally
npm i adonis-ally-azure-ad 
node ace configure adonis-ally-azure-ad

Thanks !

@kenlane33
Copy link

kenlane33 commented Jan 27, 2023

I was able to import AAD like this:
import { AAD } from 'adonis-ally-azure-ad/build/src/AzureAD'

Then I dug around in the commits and see the export of AADConfig is deleted in this commit: e4bf29b

I jammed the deleted code directly into contracts/ally.ts (naughty):

import { LiteralStringUnion } from '@ioc:Adonis/Addons/Ally'
export type AADScopes = string
export type AADConfig = {
  driver: 'AzureAD'
  clientId: string
  clientSecret: string
  callbackUrl: string
  authorizeUrl?: string
  accessTokenUrl?: string
  userInfoUrl?: string
  scopes?: LiteralStringUnion<AADScopes>[]
}

and then I was able to configure as the instructions.md described:

declare module '@ioc:Adonis/Addons/Ally' {
  interface SocialProviders {
    // ... other mappings
    AzureAD: {
      config: AADConfig
      implementation: AAD
    }
  }
}

I think the standalone folder was forgotten in the later commits, perhaps?

@AlexanderYW
Copy link
Owner

Sorry, for the late response, I'm on paternity leave and have alot to deal with (The kid, house and insurance claims). but I'm getting some more free time now.

I quickly looking into this, and yes it seems like the types are not exported within the build/standalone, but I believe I have a fix for it. Just need to test it out, and when it's tested, I will release a hotfix I hope you guys are up for testing :)

@AlexanderYW
Copy link
Owner

Checkout the latest version 0.3.1 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants