# File app/controllers/users/omniauth_callbacks_controller.rb, line 10 def facebook # You need to implement the method below in your model (e.g. app/models/user.rb) @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) data=request.env["omniauth.auth"] session[:fbuser_access_token]=data.credentials.token if @user sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format? else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end
# File app/controllers/users/omniauth_callbacks_controller.rb, line 4 def failure # flash[:notice] = "Failure #{Hash.new(request.env)} #{Hash.new(params)}" #redirect_to new_user_registration_url , :notice=>"Omniauth Login failed" super end
# File app/controllers/users/omniauth_callbacks_controller.rb, line 25 def ldap logger.debug current_user.to_s @user=User.find_for_ldap_oauth(request.env["omniauth.auth"],current_user) # @user=User.find_for_ldap_oauth(session["devise.ldap_data"],current_user) # @user=User.first # flash[:notice]="#{request.env}" # sign_in_and_redirect @user, :event=>:authentication # debug @user #debug # logger.info "Request attributes hash: #{request.env}" if @user sign_in_and_redirect @user, :event => :authentication set_flash_message(:notice,:success,:kind=>"Ldap") if is_navigational_format? else session["devise.ldap_data"]=request.env["omniauth.auth"] # set_flash_message(:notice, "sdfsdf") flash[:notice]=flash[:notice] + "Still not logged in " redirect_to new_user_registration_url end end
Generated with the Darkfish Rdoc Generator 2.