Giter Site home page Giter Site logo

azure-directory's Introduction

Azure Active Directory Graph API

Description

Simple Azure Active Directory Graph API wrapper for Ruby on Rails.

The API authentication protocol is a service to service call using OAuth2 client credentials. For more information go to Azure Documentation.

This library is in alpha. Future incompatible changes may be necessary.

Install

Add the gem to the Gemfile

gem 'azure-directory'

Configuration

First configure your API client in config/initializers/azure_directory.rb

Azure::Directory.configure do
	
	# OPTIONAL. Use a YAML file to store the requested access tokens. When the token is refreshed, this file will be updated.
	use_yaml Rails.root.join('config', 'google_directory.yaml')

	# Required attributes
	client_id       ''
	client_secret   ''
	tenant_id       ''
	resource_id     ''

end

Multiple API clients using scopes

Specify a single or multiple scopes in the configuration file.

Azure::Directory.configure do
	
	scope :domain_one do
		client_id       ''
		client_secret   ''
		# [...]
	end

	scope :domain_two do
		client_id       ''
		client_secret   ''
		# [...]
	end

end

Usage

azure = Azure::Directory::Client.new

azure.find_users

azure.find_user_groups_by_email("email")

azure.create_user("email", "given_name", "family_name", "password")

azure.update_user("email", update_data)

azure.update_user_password("email", "new_password")

Multiple Scopes

domain_one = Azure::Directory::Client.new(:domain_one)
domain_one.find_users

domain_two = Azure::Directory::Client.new(:domain_two)
domain_two.find_users

TO DO

  • use_active_model for database token store
  • Build the configuration generator
  • Implement the Azure's REST API calls
  • Abstract the API's Entities into ruby models Entity Reference
  • Better error handling
  • Testing

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.