Skip to content

Optum/pontifex-aad

Repository files navigation

Contributors Forks Stargazers Issues MIT License


pontifex-aad

Making working with Azure Active Directory + Oauth2 Easy

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

Helper package for managing App Registrations, App Roles, and permission granting within Azure Active Directory.

(back to top)

Built With

(back to top)

Getting Started

Installation

  1. Clone the repo
    git clone https://github.com/Optum/pontifex-aad.git
  2. Install NPM packages
    npm install

(back to top)

Usage

Creating an App Registration and associated Service Principal

const application = await pontifex.application.create({
    "displayName": `${environment}-${request.applicationName}`,
    "api": {
        "requestedAccessTokenVersion": 2 // tell AAD to use v2 OAuth2 tokens
    }
})

context.log(`application created. objectId: ${application.id}, appId: ${application.appId}`)

context.log(`creating service principal for appId ${application.appId}`)
await pontifex.servicePrincipal.create(application.appId)

Granting Access to an App Role

const roleAssignmentId = await pontifex.servicePrincipal.grantPermission(clientServicePrincipal.id,
    resourceServicePrincipal.id, appRole.id)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the Apache 2.0 License. See LICENSE.txt for more information.

(back to top)

Maintainers

(back to top)

About

Azure Active Directory helper module for Pontifex

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •