summaryrefslogtreecommitdiff
path: root/lib/azure_ex/application.ex
blob: e6be1d48beecf23106ffe43a9ea84799f5d8b585 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
defmodule AzureEx.Application do
  @moduledoc false

  use Application

  def start(_tuple, _args) do
    opts = [strategy: :one_for_one, name: AzureEx.Supervisor]

    Supervisor.start_link([{AzureEx.TokenHosting, get_client_oauth_params()}], opts)
  end

  defp get_client_oauth_params do
    tenant = Application.get_env(:azure_ex, :tenant)
    client_id = Application.get_env(:azure_ex, :client_id)
    client_secret = Application.get_env(:azure_ex, :client_secret)

    [tenant: tenant, client_id: client_id, client_secret: client_secret]
  end
end