Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/navarabv/nativescript-adal
NativeScript Active Directory Authentication Library plugin
https://github.com/navarabv/nativescript-adal
active-directory nativescript
Last synced: 3 months ago
JSON representation
NativeScript Active Directory Authentication Library plugin
- Host: GitHub
- URL: https://github.com/navarabv/nativescript-adal
- Owner: NavaraBV
- License: mit
- Created: 2017-09-29T07:06:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-28T00:07:56.000Z (4 months ago)
- Last Synced: 2024-10-11T13:41:53.032Z (3 months ago)
- Topics: active-directory, nativescript
- Language: TypeScript
- Size: 1.89 MB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NativeScript Active Directory Authentication Library Plugin
[![Build Status][build-status]][build-url]
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![BCH compliance][bch-url-repo]][bch-url][build-status]:https://travis-ci.org/NavaraBV/nativescript-adal.svg?branch=master
[build-url]:https://travis-ci.org/NavaraBV/nativescript-adal
[bch-url-repo]:https://bettercodehub.com/edge/badge/NavaraBV/nativescript-adal?branch=master
[bch-url]:https://bettercodehub.com/
[npm-image]:https://img.shields.io/npm/v/@navara/nativescript-adal.svg
[npm-url]:https://npmjs.org/package/@navara/nativescript-adal
[downloads-image]:http://img.shields.io/npm/dm/@navara/nativescript-adal.svgThis plugin allows you to quickly add Azure Active Directory Authentication to your NativeScript app
## Prerequisites / Requirements
Your application requires to be registered inside your Azure Active Directory (AAD). Visit the [Azure Portal](https://portal.azure.com) and log in with your organizational account. Grab your Azure AD Tenant ID and Application ID after registering your application.
## Installation
```javascript
tns plugin add @navara/nativescript-adal
```## Usage (Angular example)
Import the AdalContext class in application in, for example, an 'AdalService' and initialize it.
```javascript
import { Injectable } from '@angular/core';
import { AdalContext } from '@navara/nativescript-adal';const authority: string = 'https://login.microsoftonline.com/{your-tenant-id}';
const clientId: string = '{your-application-id}';
const resourceId: string = '00000002-0000-0000-c000-000000000000';@Injectable()
export class AdalService {public adalContext: AdalContext;
constructor() {
this.adalContext = new AdalContext(authority, clientId, resourceId);
}
}
```...and consume this service in your application!
```javascript
export class AppComponent {constructor(private adalService: AdalService) { }
public login() {
this.adalService.adalContext.login().then((result) => {
console.log('Success!');
})
}
}
```## Known issues on iOS
#### Trouble running on the simulator
Open or create `App_Resources/iOS/.entitlements` and add these two keys with the value `true`:```xml
com.apple.keystore.access-keychain-keys
com.apple.keystore.device
```
## LicenseSee [LICENSE](LICENSE) for details.