Central Authentication Service strategy for Überauth.
-
Add
ueberauth
andueberauth_cas
to your list of dependencies inmix.exs
:def deps do [ {:ueberauth, "~> 0.2"}, {:ueberauth_cas, "~> 1.0.0"}, ] end
-
Ensure
ueberauth_cas
is 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", ]}]
-
In
AuthController
use the CAS strategy in yourlogin/4
function:def login(conn, _params, _current_user, _claims) do conn |> Ueberauth.Strategy.CAS.handle_request! end
Ü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.