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.
npm install react-native-azure-adalActive 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.

---
See Android guide and iOS guide
``bash`
import AzureAdal from 'react-native-azure-adal';
1. Configure
`javascript`
/**
*
* @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)
2. Login
`javascript`
/**
* 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)
3. login With LoginPrompt
`javascript`
/**
* 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)
4. Get Token
`javascript`
/**
* 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)
5. Logout
`javascript``
/**
* Sign out from your application
*/
logout ()
Please refer example project for more details
See the example project for a working example.
Just submit a pull request!
Drop a mail to durgaprasad.budhwani@gmail.com
- [ ] Integrate Azure AD Log
- [ ] Handle token caching in better way
- [ ] Unit Test Case
- [ ] Code Quality Integration tool - Eslint and Flow
Code released under the Apache License.