View Source Ueberauth.Strategy.IdAustria (Überauth IDAustria v0.2.0)

Provides an Ueberauth strategy for authenticating with ID Austria (the austrian eIDAS implementation). See the eIDAS Regulation for infos about eIDAS.

Setup

You need to register your application with the austrian government.

Information about registering can be obtained from the EGIZ.

Include the provider in your configuration for Ueberauth

config :ueberauth, Ueberauth,
  providers: [
    eid: { Ueberauth.Strategy.IdAustria, [] }
  ]

Then include the configuration:

config :ueberauth, Ueberauth.Strategy.IdAustria.OAuth,
  client_id: System.get_env("EID_CLIENT_ID"),
  client_secret: System.get_env("EID_CLIENT_SECRET")

If you haven't already, create a pipeline and setup routes for your callback handler

pipeline :auth do
  Ueberauth.plug "/auth"
end

scope "/auth" do
  pipe_through [:browser, :auth]

  get "/:provider/callback", AuthController, :callback
end

Create an endpoint for the callback where you will handle the Ueberauth.Auth struct

defmodule MyApp.AuthController do
  use MyApp.Web, :controller

  def callback_phase(%{ assigns: %{ ueberauth_failure: fails } } = conn, _params) do
    # do things with the failure
  end

  def callback_phase(%{ assigns: %{ ueberauth_auth: auth } } = conn, params) do
    # do things with the auth
  end
end

Summary

Functions

Includes the credentials from the ID Austria token response.

Stores the raw information obtained from the ID Austria id_token.

Cleans up the private area of the connection used for passing the raw ID Austria response around during the callback.

Handles the initial redirect to the ID Austria authentication page.

Fetches the fields to populate the info section of the Ueberauth.Auth struct.

Fetches the uid field from the id token.

Functions

Includes the credentials from the ID Austria token response.

Callback implementation for Ueberauth.Strategy.default_options/0.

Stores the raw information obtained from the ID Austria id_token.

Cleans up the private area of the connection used for passing the raw ID Austria response around during the callback.

Handles the initial redirect to the ID Austria authentication page.

The request will include the state parameter that was set by ueberauth (if available)

Fetches the fields to populate the info section of the Ueberauth.Auth struct.

Fetches the uid field from the id token.