I'm attempting to use the omniauth-wordpress_hosted gem to sign into a WordPress site, but I keep getting an error:
"Not found. Authentication passthru."
Here's my gemfile:
gem 'devise'
gem 'omniauth'
gem 'omniauth-wordpress_hosted', github: 'jwickard/omniauth-wordpress-oauth2-plugin'
Here's my Omniauth Callbacks Controller:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def wordpress_oauth2
#You need to implement the method below in your model (e.g. app/models/user.rb)
@user = User.find_for_wordpress_oauth2(request.env["omniauth.auth"], current_user)
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Wordpress Oauth2"
sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
else
session["devise.wordpress_oauth2_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
end
Here's my devise.rb:
config.omniauth :wordpress_oauth2,
"63A25y8nPbM113iAfyoZQBnH2bR2Ve", "x2h74mGdJwowyqzR0OpoOfZbW1mN4i",
strategy_class: OmniAuth::Strategies::WordpressHosted,
client_options: {
site: 'http://example.exampleurl.com'
}
And lastly, my routes:
devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
Am I missing anything? I've followed the Facebook tutorial for Omniauth and haven't seen anything glaring that I'm missing.
I'm on the latest versions of Rails and Devise, along with Ruby 2.2.2
I'm attempting to use the omniauth-wordpress_hosted gem to sign into a WordPress site, but I keep getting an error:
"Not found. Authentication passthru."
Here's my gemfile:
gem 'devise'
gem 'omniauth'
gem 'omniauth-wordpress_hosted', github: 'jwickard/omniauth-wordpress-oauth2-plugin'
Here's my Omniauth Callbacks Controller:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def wordpress_oauth2
#You need to implement the method below in your model (e.g. app/models/user.rb)
@user = User.find_for_wordpress_oauth2(request.env["omniauth.auth"], current_user)
end
end
Here's my devise.rb:
config.omniauth :wordpress_oauth2,
"63A25y8nPbM113iAfyoZQBnH2bR2Ve", "x2h74mGdJwowyqzR0OpoOfZbW1mN4i",
strategy_class: OmniAuth::Strategies::WordpressHosted,
client_options: {
site: 'http://example.exampleurl.com'
}
And lastly, my routes:
devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
Am I missing anything? I've followed the Facebook tutorial for Omniauth and haven't seen anything glaring that I'm missing.
I'm on the latest versions of Rails and Devise, along with Ruby 2.2.2