https://github.com/optum/pontifex-aad
Azure Active Directory helper module for Pontifex
https://github.com/optum/pontifex-aad
azure-active-directory pontifex
Last synced: about 1 month ago
JSON representation
Azure Active Directory helper module for Pontifex
- Host: GitHub
- URL: https://github.com/optum/pontifex-aad
- Owner: Optum
- License: apache-2.0
- Created: 2022-08-23T14:42:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T18:43:01.000Z (over 3 years ago)
- Last Synced: 2025-03-11T15:51:10.530Z (about 1 year ago)
- Topics: azure-active-directory, pontifex
- Language: TypeScript
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
pontifex-aad
Making working with Azure Active Directory + Oauth2 Easy
Table of Contents
## About The Project
Helper package for managing App Registrations, App Roles, and permission granting within Azure Active Directory.
### Built With
* [Typescript](https://www.typescriptlang.org/)
## Getting Started
### Installation
1. Clone the repo
```sh
git clone https://github.com/Optum/pontifex-aad.git
```
2. Install NPM packages
```sh
npm install
```
## Usage
### Creating an App Registration and associated Service Principal
```typescript
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
```typescript
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
## License
Distributed under the Apache 2.0 License. See `LICENSE.txt` for more information.
## Maintainers
- Alexander Aavang
- GitHub Enterprise: [aaavang](https://github.com/aaavang)
- Email: alexander.aavang@optum.com, alex.aavang@gmail.com
[contributors-shield]: https://img.shields.io/github/contributors/Optum/pontifex-aad.svg?style=for-the-badge
[contributors-url]: https://github.com/Optum/pontifex-aad/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Optum/pontifex-aad.svg?style=for-the-badge
[forks-url]: https://github.com/Optum/pontifex-aad/network/members
[stars-shield]: https://img.shields.io/github/stars/Optum/pontifex-aad.svg?style=for-the-badge
[stars-url]: https://github.com/Optum/pontifex-aad/stargazers
[issues-shield]: https://img.shields.io/github/issues/Optum/pontifex-aad.svg?style=for-the-badge
[issues-url]: https://github.com/Optum/pontifex-aad/issues
[license-shield]: https://img.shields.io/github/license/Optum/pontifex-aad.svg?style=for-the-badge
[license-url]: https://github.com/Optum/pontifex-aad/blob/master/LICENSE.txt