GithubHelp home page GithubHelp logo

kenlaikh / azure-activedirectory-library-for-react-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from durgaprasad-budhwani/azure-activedirectory-library-for-react-native

0.0 0.0 0.0 542 KB

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.

License: Apache License 2.0

Java 27.57% JavaScript 15.38% Objective-C 33.33% Ruby 1.71% PowerShell 2.74% Shell 17.20% Starlark 2.08%

azure-activedirectory-library-for-react-native's Introduction

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.

npm version

Inspired By

  1. ADAL for Cordova
  2. ADAL for React Native

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

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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.

azure-activedirectory-library-for-react-native's People

Contributors

durgaprasad-budhwani avatar kenlaikh avatar sushant-sardeshpande avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.