diff --git a/lib/assent/strategies/apple.ex b/lib/assent/strategies/apple.ex index b92dd61..09200ba 100644 --- a/lib/assent/strategies/apple.ex +++ b/lib/assent/strategies/apple.ex @@ -13,7 +13,8 @@ defmodule Assent.Strategy.Apple do client_id: "REPLACE_WITH_SERVICES_ID", team_id: "REPLACE_WITH_TEAM_ID", private_key_id: "REPLACE_WITH_PRIVATE_KEY_ID", - private_key_path: "/path/to/key.p8" + private_key_path: "/path/to/private_key.p8", + redirect_uri: "http://localhost:4000/auth/callback" ] ## With JS SDK diff --git a/lib/assent/strategies/auth0.ex b/lib/assent/strategies/auth0.ex index aeb5df9..c8903e9 100644 --- a/lib/assent/strategies/auth0.ex +++ b/lib/assent/strategies/auth0.ex @@ -7,7 +7,8 @@ defmodule Assent.Strategy.Auth0 do config = [ client_id: "REPLACE_WITH_CLIENT_ID", client_secret: "REPLACE_WITH_CLIENT_SECRET", - domain: "REPLACE_WITH_DOMAIN" + domain: "REPLACE_WITH_DOMAIN", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/azure_ad.ex b/lib/assent/strategies/azure_ad.ex index 3fd7663..18fbd51 100644 --- a/lib/assent/strategies/azure_ad.ex +++ b/lib/assent/strategies/azure_ad.ex @@ -12,7 +12,8 @@ defmodule Assent.Strategy.AzureAD do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] A tenant id can be set to limit scope of users who can get access (defaults @@ -21,7 +22,8 @@ defmodule Assent.Strategy.AzureAD do config = [ client_id: "REPLACE_WITH_CLIENT_ID", client_secret: "REPLACE_WITH_CLIENT_SECRET", - tenant_id: "REPLACE_WITH_TENANT_ID" + tenant_id: "REPLACE_WITH_TENANT_ID", + redirect_uri: "http://localhost:4000/auth/callback" ] ## Setting up Azure AD diff --git a/lib/assent/strategies/basecamp.ex b/lib/assent/strategies/basecamp.ex index 71d84b2..ef25fbf 100644 --- a/lib/assent/strategies/basecamp.ex +++ b/lib/assent/strategies/basecamp.ex @@ -12,7 +12,8 @@ defmodule Assent.Strategy.Basecamp do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/digital_ocean.ex b/lib/assent/strategies/digital_ocean.ex index 116d6e8..5eaffb9 100644 --- a/lib/assent/strategies/digital_ocean.ex +++ b/lib/assent/strategies/digital_ocean.ex @@ -6,7 +6,8 @@ defmodule Assent.Strategy.DigitalOcean do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/discord.ex b/lib/assent/strategies/discord.ex index 8144ffe..b1620ad 100644 --- a/lib/assent/strategies/discord.ex +++ b/lib/assent/strategies/discord.ex @@ -6,7 +6,8 @@ defmodule Assent.Strategy.Discord do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/facebook.ex b/lib/assent/strategies/facebook.ex index 9163601..f01cf6d 100644 --- a/lib/assent/strategies/facebook.ex +++ b/lib/assent/strategies/facebook.ex @@ -17,7 +17,8 @@ defmodule Assent.Strategy.Facebook do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/github.ex b/lib/assent/strategies/github.ex index f2caab8..9eb7ce2 100644 --- a/lib/assent/strategies/github.ex +++ b/lib/assent/strategies/github.ex @@ -12,7 +12,8 @@ defmodule Assent.Strategy.Github do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/gitlab.ex b/lib/assent/strategies/gitlab.ex index b05034f..f53c0e3 100644 --- a/lib/assent/strategies/gitlab.ex +++ b/lib/assent/strategies/gitlab.ex @@ -6,7 +6,8 @@ defmodule Assent.Strategy.Gitlab do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/google.ex b/lib/assent/strategies/google.ex index c1152d2..318079d 100644 --- a/lib/assent/strategies/google.ex +++ b/lib/assent/strategies/google.ex @@ -10,7 +10,8 @@ defmodule Assent.Strategy.Google do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] To get the refresh token, it's necessary to pass `access_type: "offline"` in diff --git a/lib/assent/strategies/instagram.ex b/lib/assent/strategies/instagram.ex index 60b4aba..cea0ee5 100644 --- a/lib/assent/strategies/instagram.ex +++ b/lib/assent/strategies/instagram.ex @@ -9,7 +9,8 @@ defmodule Assent.Strategy.Instagram do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/line.ex b/lib/assent/strategies/line.ex index 32cedb3..8df3f64 100644 --- a/lib/assent/strategies/line.ex +++ b/lib/assent/strategies/line.ex @@ -6,7 +6,8 @@ defmodule Assent.Strategy.LINE do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OIDC` for more. diff --git a/lib/assent/strategies/linkedin.ex b/lib/assent/strategies/linkedin.ex index c8a7971..a994620 100644 --- a/lib/assent/strategies/linkedin.ex +++ b/lib/assent/strategies/linkedin.ex @@ -10,7 +10,8 @@ defmodule Assent.Strategy.Linkedin do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OIDC` for more. diff --git a/lib/assent/strategies/oauth2.ex b/lib/assent/strategies/oauth2.ex index 2bedf2a..99f8647 100644 --- a/lib/assent/strategies/oauth2.ex +++ b/lib/assent/strategies/oauth2.ex @@ -59,6 +59,7 @@ defmodule Assent.Strategy.OAuth2 do {:ok, %{user: user, token: token}} = config + |> Assent.Config.put(:redirect_uri, "http://localhost:4000/auth/callback") |> Assent.Config.put(:session_params, session_params) |> Assent.Strategy.OAuth2.callback(params) """ diff --git a/lib/assent/strategies/oidc.ex b/lib/assent/strategies/oidc.ex index d455b96..79caa4b 100644 --- a/lib/assent/strategies/oidc.ex +++ b/lib/assent/strategies/oidc.ex @@ -44,6 +44,7 @@ defmodule Assent.Strategy.OIDC do {:ok, %{user: user, token: token}} = config + |> Assent.Config.put(:redirect_uri, "http://localhost:4000/auth/callback") |> Assent.Config.put(:session_params, session_params) |> Assent.Strategy.OIDC.callback(params) diff --git a/lib/assent/strategies/slack.ex b/lib/assent/strategies/slack.ex index b82f12a..2edb518 100644 --- a/lib/assent/strategies/slack.ex +++ b/lib/assent/strategies/slack.ex @@ -15,7 +15,8 @@ defmodule Assent.Strategy.Slack do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] By default, the user can decide what team should be used for authorization. @@ -25,7 +26,8 @@ defmodule Assent.Strategy.Slack do config = [ client_id: "REPLACE_WITH_CLIENT_ID", client_secret: "REPLACE_WITH_CLIENT_SECRET", - team_id: "XXXXXXX" + team_id: "REPLACE_WITH_TEAM_ID", + redirect_uri: "http://localhost:4000/auth/callback" ] This value will be not be used if you set a `authorization_params` key. diff --git a/lib/assent/strategies/spotify.ex b/lib/assent/strategies/spotify.ex index a63737e..b71a554 100644 --- a/lib/assent/strategies/spotify.ex +++ b/lib/assent/strategies/spotify.ex @@ -6,7 +6,8 @@ defmodule Assent.Strategy.Spotify do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/strava.ex b/lib/assent/strategies/strava.ex index 2fdacfc..3fc4636 100644 --- a/lib/assent/strategies/strava.ex +++ b/lib/assent/strategies/strava.ex @@ -9,7 +9,8 @@ defmodule Assent.Strategy.Strava do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/stripe.ex b/lib/assent/strategies/stripe.ex index d93c477..5f712fb 100644 --- a/lib/assent/strategies/stripe.ex +++ b/lib/assent/strategies/stripe.ex @@ -6,7 +6,8 @@ defmodule Assent.Strategy.Stripe do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth2` for more. diff --git a/lib/assent/strategies/twitter.ex b/lib/assent/strategies/twitter.ex index e2845d0..a8718b9 100644 --- a/lib/assent/strategies/twitter.ex +++ b/lib/assent/strategies/twitter.ex @@ -9,7 +9,8 @@ defmodule Assent.Strategy.Twitter do config = [ consumer_key: "REPLACE_WITH_CONSUMER_KEY", - consumer_secret: "REPLACE_WITH_CONSUMER_SECRET" + consumer_secret: "REPLACE_WITH_CONSUMER_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] See `Assent.Strategy.OAuth` for more. diff --git a/lib/assent/strategies/vk.ex b/lib/assent/strategies/vk.ex index 397a267..472a89b 100644 --- a/lib/assent/strategies/vk.ex +++ b/lib/assent/strategies/vk.ex @@ -16,7 +16,8 @@ defmodule Assent.Strategy.VK do config = [ client_id: "REPLACE_WITH_CLIENT_ID", - client_secret: "REPLACE_WITH_CLIENT_SECRET" + client_secret: "REPLACE_WITH_CLIENT_SECRET", + redirect_uri: "http://localhost:4000/auth/callback" ] """ use Assent.Strategy.OAuth2.Base