An open API service indexing awesome lists of open source software.

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

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



  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

* [Typescript](https://www.typescriptlang.org/)

(back to top)

## Getting Started
### Installation

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

(back to top)

## 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

(back to top)

## License

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

(back to top)

## Maintainers

- Alexander Aavang
- GitHub Enterprise: [aaavang](https://github.com/aaavang)
- Email: alexander.aavang@optum.com, alex.aavang@gmail.com

(back to top)

[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