Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nulib/ueberauth_openam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ueberauth OpenAM Strategy

Build Coverage Hex.pm

OpenAM strategy for Ueberauth

Installation

  1. Add ueberauth and ueberauth_openam to your list of dependencies in mix.exs:
def deps do
  [
    {:ueberauth, "~> 0.2"},
    {:ueberauth_openam, "~> 0.1.0"},
  ]
end
  1. Ensure ueberauth_openam is started before your application:
def application do
  [applications: [:ueberauth_openam]]
end
  1. Configure the OpenAM integration in config/config.exs:
config :ueberauth, Ueberauth,
  providers: [openam: {Ueberauth.Strategy.OpenAM, [
    base_url: "http://websso.example.com/",
    sso_cookie: "openAMssoToken",
  ]}]
  1. Add the request and callback routes in your router (below are defaults):
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
  1. In your auth controller include the Üeberauth plug and implement the callback routes for success and failure:
defmodule MyApp.AuthController do
  use MyApp.Web, :controller

  plug Ueberauth


  def callback(%{assigns: %{ueberauth_auth: auth}} = conn, _params) do
    ...
  end

  def callback(%{assigns: %{ueberauth_failure: _fails}} = conn, _params) do
    ...
  end
end

Contributing

Issues and Pull Requests are always welcome!

About

OpenAM strategy for Überauth

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages