Überauth CAS Strategy
Central Authentication Service strategy for Überauth.
Installation
-
Add
ueberauthandueberauth_casto your list of dependencies inmix.exs:def deps do[{:ueberauth, "~> 0.2"},{:ueberauth_cas, "~> 2.0.0"}]end -
Ensure
ueberauth_casis started before your application:def application do[applications: [:ueberauth_cas]]end -
Configure the CAS integration in
config/config.exs:config :ueberauth, Ueberauth,providers: [cas: {Ueberauth.Strategy.CAS, [base_url: "http://cas.example.com",callback: "http://your-app.example.com/auth/cas/callback",]}] -
Include the Überauth plug in your controller:
defmodule MyApp.AuthController douse MyApp.Web, :controllerplug Ueberauth...end -
Create the request and callback routes if you haven't already:
scope "/auth", MyApp dopipe_through :browserget "/:provider", AuthController, :requestget "/:provider/callback", AuthController, :callbackend -
Your controller needs to implement callbacks to deal with
Ueberauth.AuthandUeberauth.Failureresponses.
Compatibility
Überauth CAS was tested with the Casino CAS server implementation. Please let me know if Überauth CAS is incompatible with your CAS server, and why.
The docs contain more information about protocol specifics.