https://github.com/nulib/ueberauth_openam
OpenAM strategy for Überauth
https://github.com/nulib/ueberauth_openam
authentication elixir openam ueberauth
Last synced: 3 months ago
JSON representation
OpenAM strategy for Überauth
- Host: GitHub
- URL: https://github.com/nulib/ueberauth_openam
- Owner: nulib
- License: mit
- Created: 2019-03-30T06:34:36.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-02-23T05:27:06.000Z (over 3 years ago)
- Last Synced: 2025-02-28T09:31:47.466Z (4 months ago)
- Topics: authentication, elixir, openam, ueberauth
- Language: Elixir
- Size: 33.2 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Ueberauth OpenAM Strategy
[](https://github.com/nulib/ueberauth_openam/actions/workflows/build.yml)
[](https://coveralls.io/github/nulib/ueberauth_openam?branch=main)
[](https://hex.pm/packages/ueberauth_openam)[OpenAM](https://github.com/OpenIdentityPlatform/OpenAM) strategy for [Ueberauth](https://github.com/ueberauth/ueberauth)
## Installation
1. Add `ueberauth` and `ueberauth_openam` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:ueberauth, "~> 0.2"},
{:ueberauth_openam, "~> 0.1.0"},
]
end
```2. Ensure `ueberauth_openam` is started before your application:
```elixir
def application do
[applications: [:ueberauth_openam]]
end
```3. Configure the OpenAM integration in `config/config.exs`:
```elixir
config :ueberauth, Ueberauth,
providers: [openam: {Ueberauth.Strategy.OpenAM, [
base_url: "http://websso.example.com/",
sso_cookie: "openAMssoToken",
]}]
```4. Add the request and callback routes in your router (below are defaults):
```
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
```5. In your auth controller include the Üeberauth plug and implement the callback routes for success and failure:
```elixir
defmodule MyApp.AuthController do
use MyApp.Web, :controllerplug Ueberauth
def callback(%{assigns: %{ueberauth_auth: auth}} = conn, _params) do
...
enddef callback(%{assigns: %{ueberauth_failure: _fails}} = conn, _params) do
...
end
end
```## Contributing
Issues and Pull Requests are always welcome!