Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/torrick/ueberauth_active_directory
Ueberauth strategy for Active Directory authentication
https://github.com/torrick/ueberauth_active_directory
Last synced: 3 months ago
JSON representation
Ueberauth strategy for Active Directory authentication
- Host: GitHub
- URL: https://github.com/torrick/ueberauth_active_directory
- Owner: torrick
- License: mit
- Archived: true
- Created: 2016-06-13T20:35:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-28T22:35:18.000Z (almost 6 years ago)
- Last Synced: 2024-07-19T00:40:28.036Z (4 months ago)
- Language: Elixir
- Homepage:
- Size: 8.79 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UeberauthActiveDirectory
Active Directory [Ueberauth](https://github.com/ueberauth/ueberauth) strategy using [Exldap](https://github.com/jmerriweather/exldap).
## Installation
Add ueberauth_active_directory to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:ueberauth_active_directory, "~> 0.1"}]
end
```Ensure ueberauth_active_directory is started before your application:
```elixir
def application do
[applications: [:ueberauth_active_directory]]
end
```Run `mix deps.get`
## Usage
Add AD server information to `.secret.exs`
Config Value | Usage
------------ | -----
server | Your Active Directory server address
base | Base distingushed name for your domain. e.g. lab.local would be `DC=lab,DC=local`
port | Ldap listening port
ssl | Enable SSL
user_dn | Bind account username in distinguishedName format
password | Bind account password```elixir
# config/dev.secret.exsconfig :ueberauth, Ueberauth.Strategy.ActiveDirectory.Ldap,
server: "192.168.250.2",
base: "DC=lab,DC=local",
port: 389,
ssl: false,
user_dn: "CN=vagrant,CN=Users,DC=lab,DC=local",
password: "vagrant"
```Configure Ueberauth to use the strategy
```elixir
# config/dev.exsconfig :ueberauth, Ueberauth,
providers: [
active_directory: { Ueberauth.Strategy.ActiveDirectory, [] },
]
```Configure authentication routes
```elixir
scope "/auth", MyApp do
pipe_through :browserget "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
```Include Überauth plug in your controller
```elixir
defmodule MyApp.AuthController do
use MyApp.Web, :controller
plug Ueberauth
...
end
```## Tests
Tests require an AD environment to run. The vagrantfile included in the repo will take care of setting up the environment for you.
### Prerequisites
* [Vagrant](https://vagrantup.com)### Running Tests
* Clone the repo
* `cd ueberauth_active_directory`
* Run `vagrant up`
* Run `mix test`