I have two separate groups of people authenticated w Devise , but in
this case I cannot used the Devise embedded OmniAuth support. So i am
using directly the OmniAuth gem.

Initialized w :
Rails.configuration.middleware.use OmniAuth::Builder do
..provider :twitter,
..
end

It's running fine , but I have an issue with the callback route
mapping :

I tried
match '/users/auth/:provider/callback', to: 'users/
omniauth_callbacks#create'
match '/members/auth/:provider/callback', to: 'members/
omniauth_callbacks#create'
but the provider ( fb , twitter, google) claimebd about the callback
uri :
"/auth/:provider/callback"
..
as the path_prefix (:path_prefix => "/auth" ) is set in the
initializer , I have no mean to modify it dynamically...

any clue ? or feedback from previous experiences...

thanks


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Erwin at Oct 7, 2012 at 9:03 am
    [SOLVED] maybe not the best way, but it runs ..
    using only one callback url, I can test the
    request.env["omniauth.origin"] which can be tested :

    "http://lvh.me:3000/en/users/sign_in"
    or
    "http://acme.lvh.me:3000/en/members/sign_in" ( in this cas I can even
    test for current_subdomain.nil?



    On 6 oct, 19:06, Erwin wrote:
    I have two separate groups of people authenticated w Devise , but in
    this case I cannot used the Devise embedded OmniAuth support. So i am
    using directly the OmniAuth gem.

    Initialized w :
    Rails.configuration.middleware.use OmniAuth::Builder do
    ..provider :twitter,
    ..
    end

    It's running fine , but I have an issue with the callback route
    mapping :

    I tried
    match '/users/auth/:provider/callback', to: 'users/
    omniauth_callbacks#create'
    match '/members/auth/:provider/callback', to: 'members/
    omniauth_callbacks#create'
    but the provider ( fb , twitter, google)  claimebd about the callback
    uri :
    "/auth/:provider/callback"
    ..
    as the path_prefix (:path_prefix => "/auth" )  is set in the
    initializer , I have no mean to modify it dynamically...

    any clue ? or feedback from previous experiences...

    thanks
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 6, '12 at 5:11p
activeOct 7, '12 at 9:03a
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Erwin: 2 posts

People

Translate

site design / logo © 2021 Grokbase