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
Any way to customize '/auth/:provider/callback' url? #593
Comments
You can customize the callback path like so: provider :providername, :callback_path => "/auth/providername/mobile/callback" |
In the initializer? |
Can i specify two callback paths, as i explained before? I still don't understand, sorry.. |
@sadfuzzy did you ever figure this out? |
@adamgotterer yeah, @mbleigh's answer worked for me |
@sadfuzzy would be helpful if you can describe your solution. I have somewhat similar situation. I am looking to use a single provider to authenticate two different types of users - say (1) employee and (2) customer. An elegant way, in my opinion, would be to use different callback urls for each user-type. |
I'm trying to do the same as @shireesh. I have two different types of users Customer and Vendor. I'd like to use the paths /customer/auth/:provider/callback and /vendor/auth/:provider/callback. Otherwise I'm not sure how to do single sign on with two different types of users from within the same app. |
I think its specific per omni auth provider. In Google oauth its redirect_to redirect_uri . Not sure how helpful this will be. But this is how I do it through devise. redirect_to user_omniauth_authorize_path(:google_oauth2, redirect_uri: ...) |
@sadfuzzy You can use the # config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :providername, :callback_path => "/auth/providername/mobile/callback"
end |
I want to call the api post call url http://localhost:3000/api/v1/auth/identity/callback .please help me to understand how can I customize the post call and routes .so the in return will get success status ,because while calling post call like "http://localhost:3000/api/v1/auth/identity/callback " not able to generate the auth_hash and getting error in postman NoMethodError at /api/v1/auth/identity/callback===============================================
|
What if I need to set a callback url that is external to my rails app domain? |
@twoneks I'd recommend fielding the callback from your rails app and then redirecting to an external domain from there. |
Any way to customize '/auth/:provider/callback' url?
Is there any way? I want this to separate mobile applications and browser(any) response in Rails.
Something like '/auth/(:client)/:provider/callback' in my routes.
One - '/auth/:provider/callback' for usual users(responds html).
Other - '/auth/mobile_app/:provider/callback' for ios/android(responds json, user auth_token).
The text was updated successfully, but these errors were encountered: