Packages

An Uberauth strategy for Instagram authentication.

Current section

2 Versions

Jump to

Compare versions

5 files changed
+8 additions
-4 deletions
  @@ -31,7 +31,7 @@
31 31 ```elixir
32 32 config :ueberauth, Ueberauth,
33 33 providers: [
34 - instagram: {Ueberauth.Strategy.instagram, []}
34 + instagram: {Ueberauth.Strategy.Instagram, []}
35 35 ]
36 36 ```
  @@ -21,4 +21,4 @@
21 21 {<<"name">>,<<"oauth2">>},
22 22 {<<"optional">>,false},
23 23 {<<"requirement">>,<<"~> 0.5">>}]]}.
24 - {<<"version">>,<<"0.1.0">>}.
24 + {<<"version">>,<<"0.2.0">>}.
  @@ -38,7 +38,7 @@ defmodule Ueberauth.Strategy.Instagram do
38 38 """
39 39 def handle_callback!(%Plug.Conn{params: %{"code" => code}} = conn) do
40 40 opts = [redirect_uri: callback_url(conn)]
41 - token = Ueberauth.Strategy.Instagram.OAuth.get_token!([code: code], opts)
41 + token = Ueberauth.Strategy.Instagram.OAuth.get_token!([code: code], opts).token
42 42
43 43 if token.access_token == nil do
44 44 err = token.other_params["error"]
  @@ -27,6 +27,7 @@ defmodule Ueberauth.Strategy.Instagram.OAuth do
27 27 def client(opts \\ []) do
28 28 config = Application.get_env(:ueberauth, Ueberauth.Strategy.Instagram.OAuth)
29 29
30 +
30 31 opts =
31 32 @defaults
32 33 |> Keyword.merge(config)
  @@ -58,6 +59,9 @@ defmodule Ueberauth.Strategy.Instagram.OAuth do
58 59 end
59 60
60 61 def get_token(client, params, headers) do
62 + params =
63 + params
64 + |> Keyword.put(:client_secret, client.client_secret)
61 65 client
62 66 |> put_header("Accept", "application/json")
63 67 |> OAuth2.Strategy.AuthCode.get_token(params, headers)
  @@ -1,7 +1,7 @@
1 1 defmodule UeberauthInstagram.Mixfile do
2 2 use Mix.Project
3 3
4 - @version "0.1.0"
4 + @version "0.2.0"
5 5 @url "https://github.com/jasontruluck/ueberauth_instagram"
6 6
7 7 def project do