react-native-azure-adal
v1.0.9
Published
Active Directory Authentication Library (ADAL) plugin provides easy to use authentication functionality for your React Native apps by taking advantage of Windows Server Active Directory and Windows Azure Active Directory.
Downloads
144
Keywords
Readme
Active Directory Authentication Library (ADAL) plugin for React Native apps
Active Directory Authentication Library (ADAL) plugin provides easy to use authentication functionality for your React Native apps by taking advantage of Windows Server Active Directory and Windows Azure Active Directory.
Inspired By
Features
- Support Non-Broker and Broker Based Authentication for Android and iOS
- Consistent API between Android and iOS
- Promise-based JS API
- Easy to configure and Use
Table of contents
Project setup and initialization
See Android guide and iOS guide
Usage
Import
import AzureAdal from 'react-native-azure-adal';
Public API
Configure
/** * * @param authority * @param validateAuthority * @param clientId * @param redirectUrl * @param useBroker if true, it will try to use broker based authentication only if broker is present */ configure (authority: String, validateAuthority: Boolean, clientId: String, redirectUrl: String, useBroker: Boolean)
Login
/** * let the user signin with azure ad credentials into your application, * if already logged in, it will not ask credentials again * @param resourceUrl * @param loginHint * @param extraQueryParameters * @returns Promise */ login (resourceUrl: String, loginHint: String, extraQueryParameters: String)
login With LoginPrompt
/** * Prompt the modal to let the user signin with azure ad credentials into your application * @param resourceUrl * @param loginHint * @param extraQueryParameters * @returns Promise */ loginWithPrompt (resourceUrl: String, loginHint: String, extraQueryParameters: String)
Get Token
/** * It will return you token * It will internally call acquireTokenSilentAsync of azure ad authentication context * Note:- One time logged in required * @param resourceUrl * @returns Promise */ getTokenAsync (resourceUrl: String)
Logout
/** * Sign out from your application */ logout ()
Please refer example project for more details
Example project
See the example project for a working example.
Contributing
Just submit a pull request!
Contact
Drop a mail to [email protected]
Todo
- [ ] Integrate Azure AD Log
- [ ] Handle token caching in better way
- [ ] Unit Test Case
- [ ] Code Quality Integration tool - Eslint and Flow
Copyright and license
Code released under the Apache License.