diff --git a/lib/oauth2/strategy/auth_code.ex b/lib/oauth2/strategy/auth_code.ex index aedea13..3732773 100644 --- a/lib/oauth2/strategy/auth_code.ex +++ b/lib/oauth2/strategy/auth_code.ex @@ -52,7 +52,7 @@ defmodule OAuth2.Strategy.AuthCode do |> put_param(:code, code) |> put_param(:grant_type, "authorization_code") |> put_param(:client_id, client.client_id) - |> put_param(:client_secret, client.client_secret) + |> put_param(:response_type, "code") |> put_param(:redirect_uri, client.redirect_uri) |> merge_params(params) |> put_headers(headers) diff --git a/test/oauth2/client_test.exs b/test/oauth2/client_test.exs index 7f8033f..8be8ed3 100644 --- a/test/oauth2/client_test.exs +++ b/test/oauth2/client_test.exs @@ -41,7 +41,7 @@ defmodule OAuth2.ClientTest do refute conn.query_string == "" assert conn.query_params["code"] == "code1234" assert conn.query_params["redirect_uri"] - assert conn.query_params["client_secret"] + assert conn.query_params["response_type"] == "code" send_resp(conn, 200, ~s({"access_token":"test1234"})) end diff --git a/test/oauth2/strategy/auth_code_test.exs b/test/oauth2/strategy/auth_code_test.exs index 38d1df7..0c64518 100644 --- a/test/oauth2/strategy/auth_code_test.exs +++ b/test/oauth2/strategy/auth_code_test.exs @@ -39,7 +39,7 @@ defmodule OAuth2.Strategy.AuthCodeTest do assert body["grant_type"] == "authorization_code" assert body["code"] == code assert body["client_id"] == client.client_id - assert body["client_secret"] == client.client_secret + assert body["response_type"] == "code" assert body["redirect_uri"] == client.redirect_uri send_resp(conn, 302, ~s({"access_token":"#{access_token}"}))