View Source ueberauth_duo

Cisco Duo OAuth2 strategy for Überauth.

Installation

  1. Set up your Duo OICD application by following these instructions.

  2. Add :ueberauth_duo to your list of dependencies in mix.exs:

    def deps do
      [
        {:ueberauth_duo, "~> 1.0"}
      ]
    end
  3. Ensure ueberauth_duo is started before your application:

    def application do
      [
        extra_applications: [:ueberauth_duo]
      ]
    end
  4. Add Duo to your Überauth configuration:

    config :ueberauth, Ueberauth,
      providers: [
        duo: {Ueberauth.Strategy.Duo, []}
      ],
  5. Update your provider configuration:

    config :ueberauth, Ueberauth.Strategy.Duo.OAuth,
      site: System.get_env("DUO_SITE"),
      client_id: System.get_env("DUO_CLIENT_ID"),
      client_secret: System.get_env("DUO_CLIENT_SECRET")
  6. Include the Überauth plug in your controller:

    defmodule MyApp.AuthController do
      use MyApp.Web, :controller
      plug Ueberauth
      ...
    end
  7. Create the request and callback routes if you haven't already:

    scope "/auth", MyApp do
      pipe_through :browser
    
      get "/:provider", AuthController, :request
      get "/:provider/callback", AuthController, :callback
    end
  8. You controller needs to implement callbacks to deal with Ueberauth.Auth and Ueberauth.Failure responses.

For an example implementation see the Überauth Example application.

Thanks!

This library is basically a copy and paste of the Okta and Microsoft Ueberauth strategies, and would not be possible without them. Thank you to the good people at Appcues and to Stuart Welham for all your hard work.

Learn about OAuth2

OAuth2 explained with cute shapes

Copyright (c) 2023 Peter Lacey

This library is released under the MIT License. See the LICENSE.md file for further details.