Giter Site home page Giter Site logo

shouse / co.grantges.azure.adal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grantges/co.grantges.azure.adal

0.0 2.0 0.0 8.46 MB

This widget provides an interface for using oAuth based authentication with Microsoft Azure

License: Apache License 2.0

JavaScript 100.00%

co.grantges.azure.adal's Introduction

Alloy Widget for Microsoft Azure ADAL Authorization Appcelerator Titanium Appcelerator Alloy

This is a widget for the Alloy MVC framework of Appcelerator's Titanium platform.

It provides an interface for using oAuth based authentication with Microsoft Azure Active Directory oAuth Login. To find out more about leveraging Microsoft Azure Active Directory Authentication, check out the Azure oAuth Documentation.

Note: This widget assumes you have the correct configuration for Microsoft Azure and your app, and that an appropriate redirect URL is setup.

Usage gitTio

  1. Install this widget via gitTio:

    gittio install co.grantges.azure.adal

  2. In your app/views/index.js use it like this:

/**

  • Provide your specific Azure specific information */ var clientId = 'YOUR_AZURE_CLIENT_ID', clientSecret = 'YOUR_AZURE_CLIENT_SECRET=', tenant='YOUR_AZURE_TENANT_GUID', //<-- optional resource = 'AZURE_AD_RESOURCE_ID';

/**

  • Create the widget */ var adalWidget = Alloy.createWidget('co.grantges.azure.adal');

/**

  • Setup the widget properties (could also be done as an object on the createWidget command) */ adalWidget.clientId = clientId; adalWidget.clientSecret = clientSecret; adalWidget.tenant = tenant; adalWidget.resourceId = resource;

/**

  • Define your callbacks */ adalWidget.success = function(e){ Ti.API.info('Azure Login and Token Retrieval was a success'); console.log(JSON.stringify(e));

/**

  • Close the widget */ adalWidget.close(); } adalWidget.error = function(e){ Ti.API.info('Azure Login and Token Retrieval had an issue, try again'); console.log(JSON.stringify(e)); }

/**

  • To use the widget, just call the authorize function. */ adalWidget.authorize();
    
    

The repository

The repository contains two branches. This master branch contains the widget. The other test branch has a complete Titanium Alloy demo/test project.

Changelog

  • 1.0.2: Fixed bad widget name references
  • 1.0.1: Initial release.

License

Copyright 2016 Bert Grantges

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

co.grantges.azure.adal's People

Contributors

grantges avatar

Watchers

 avatar  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.