Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config can be loaded dynamically #64

Merged

Conversation

docJerem
Copy link
Contributor

Motivation

This strategy cannot be loaded dynamically as the documentation specifies, see the lower snippet.

# From Ueberauth/lib/ueberauth.ex doc

# Request authentication against a provider.

# specified dynamically in arguments. For example, you can specify in a
# controller:

      def request(conn, %{"provider_name" => provider_name} = _params) do
        provider_config = case provider_name do
          "github" ->
            { Ueberauth.Strategy.Github, [
              default_scope: "user",
              request_path:  provider_auth_path(conn, :request, provider_name),
              callback_path: provider_auth_path(conn, :callback, provider_name),
            ]}
        end
        conn
        |> Ueberauth.run_request(provider_name, provider_config)
      end

Current behaviour

The request phase is stucked during the loading in the OAuth module in the Keyword merging in client/1.

Fix

Like the Google Ueberauth strategy, the fix is quiet easy :

# lib / Ueberauth / strategy / microsoft / oauth.ex line 9

    config = Application.get_env(:ueberauth, __MODULE__, [])

@swelham
Copy link
Owner

swelham commented Feb 20, 2023

Hi @docJerem, thanks for the PR. I totally missed that when upgrading uberauth versions!

@swelham swelham merged commit 52f53f3 into swelham:master Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants