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

Passing custom parameters to auth flow #16

Closed
venkatd opened this issue Jul 26, 2016 · 2 comments
Closed

Passing custom parameters to auth flow #16

venkatd opened this issue Jul 26, 2016 · 2 comments
Labels

Comments

@venkatd
Copy link
Contributor

venkatd commented Jul 26, 2016

Without access_type, I'm not able to get a refresh token for offline access, so I patched the lib for some customer parameters that I wanted.

  @doc """
  Handles initial request for Google authentication.
  """
  def handle_request!(conn) do
    scopes = conn.params["scope"] || option(conn, :default_scope)
    # added response_type, access_type, and approval_prompt
    opts = [ scope: scopes, response_type: "code", access_type: "offline", approval_prompt: "force" ]
    if conn.params["state"], do: opts = Keyword.put(opts, :state, conn.params["state"])
    opts = Keyword.put(opts, :redirect_uri, callback_url(conn))

    redirect!(conn, Ueberauth.Strategy.Google.OAuth.authorize_url!(opts))
  end

What is the proper way to pass custom options? If this isn't supported, what can I do to help improve the library? Thanks!

@nambrot
Copy link

nambrot commented Aug 22, 2016

Just stumbled across this one, and would also support having the ability to have offline access

@doomspork
Copy link
Member

Address in #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants