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

@azure/identity-TokenCredential #371

Merged
merged 29 commits into from
Jan 27, 2021
Merged

@azure/identity-TokenCredential #371

merged 29 commits into from
Jan 27, 2021

Conversation

nikithauc
Copy link
Contributor

@nikithauc nikithauc commented Jan 4, 2021

  1. Introduces TokenCredentialAuthenticationProvider option so that authentication can be done using the @azure/identity- tokenCredential classes.
  2. Added samples illustration the use of TokenCredentialAuthenticationProvider using AuthenticationCodeFlow and ClientCredentialFlow
  3. Added and updated documents.
  4. Introducing the authentication subfolder in src/ changing the structure of the source folders.
  5. Added authProviderOptions/ folder which exports the msal and TokenCredential authentication provider options. This is done so that the we can use import {TokenCredentialAuthenticationProvider} from@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials. This is a workaround for the limitations Recommendation for exposing multiple TypeScript modules from single NPM package microsoft/TypeScript#8305 ,
    Support for NodeJS 12.7+ package exports microsoft/TypeScript#33079.

The idea for using a submodule structure to export the authProviderOptions is because -

  1. We are not exporting TokenCredentialAuthenticationProvider and ImplicitMsalAuthenticationProvider in the src/index.ts. This makes msal and @azure/identity an optional dependency for the user of the sdk. Marking them as option using peerDependenciesMeta.

  2. ImplicitMSALAuthenticationProvider is not exported in index.js #230 - ImplicitMsalAuthenticationProvider was not exported in JS SDK version < 2.1 as using msal was optional but exporting in the index file would make msal a runtime dependency.

  3. To import TokenCredentialAuthenticationProvider and ImplicitMsalAuthenticationProvider, the paths would be

     const {TokenCredentialAuthenticationProvider} = require("@microsoft/microsoft-graph- 
     client/authProviders/azureTokenCredentials");
     
     const{ImplicitMSALAuthenticationProvider}  = require("@microsoft/microsoft-graph-client/authProviders/msal");
    
  4. Added tsconfig-sub-x.json to build the project using TypeScript Project References

@nikithauc
Copy link
Contributor Author

This PR depends on #370

README.md Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
docs/ImplicitMSALAuthenticationProvider.md Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
versionTest.yml Outdated Show resolved Hide resolved
@nikithauc nikithauc changed the base branch from dev to 3.0.0 January 5, 2021 23:59
@nikithauc nikithauc added this to the 3.0.0 milestone Jan 6, 2021
package.json Outdated Show resolved Hide resolved
@nikithauc nikithauc marked this pull request as ready for review January 12, 2021 20:02
@ddyett
Copy link
Contributor

ddyett commented Jan 12, 2021

may also be good to have a pure javascript sample at some point

Copy link
Contributor

@zengin zengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for nitpicking on the typos. I added those comments as most of them appear in public documentation (MD files).

.gitignore Outdated Show resolved Hide resolved
docs/ImplicitMSALAuthenticationProvider.md Outdated Show resolved Hide resolved
docs/TokenCredentialAuthenticationProvider.md Outdated Show resolved Hide resolved
docs/TokenCredentialAuthenticationProvider.md Outdated Show resolved Hide resolved
docs/TokenCredentialAuthenticationProvider.md Outdated Show resolved Hide resolved
@nikithauc
Copy link
Contributor Author

Sorry for nitpicking on the typos. I added those comments as most of them appear in public documentation (MD files).

Thanks for point those out. I should be careful about that.

@nikithauc
Copy link
Contributor Author

may also be good to have a pure javascript sample at some point

Added.

@nikithauc nikithauc merged commit c41881f into 3.0.0 Jan 27, 2021
@Stono
Copy link

Stono commented Feb 5, 2021

Hey folks
I'm wondering if you have an ETA on 3.0.0 as I need this PR :)
Thanks

@nikithauc nikithauc deleted the Authentication branch May 3, 2021 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authentication Provider to connect with Client Id and Secret/Certificate
5 participants