Coder Social home page Coder Social logo

Comments (1)

robdimarco avatar robdimarco commented on June 19, 2024

I am only using :crowd as provider in my project, twitter was used in test purposes, I just wanted to check
differenses with crawd login behavior and twitter.

I will copy few code samples, may be you could point me in the source of the problem.

omniauth.rb:

require 'net/http'

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :crowd, :crowd_server_url=>"http://xx.xx.xx.xx:17004/crowd", :application_name=>"bama", :application_password=>"bama"
end

routes.rb:

get '/auth/:provider/callback' => "login#callback"
get '/auth/:provider/failure' => "login#failed"

LoginController.rb

def index
  @msg = request.env['omniauth.auth']

  render "index"
end

def failed
  @msg = "failed"
  render "index"
end

View for controller just rendering the @msg property. So it is easy as a pie and I have no idea what is wrong with this code.
English is not my native language, may be I am not too strict, I will try to explain again :)

When I am logging into crowd from my application (/crowd/auth/, then entering the credentials) - I am getting next data from request.env['omniauth.auth']:

{"provider"=>"crowd", "uid"=>"bama1", "user_info"=>{"name"=>"Bama 1", "first_name"=>"Bama", "last_name"=>"1", "email"=>"[email protected]"}}

If I am entering wrong credentials, '/auth/:provider/failure' triggers, so I have assumed that when I getting the above callback ->
user is logged.

But next time I am logging again in few seconds - I got rendered 'crowd login page again'. Even if I logging into crowd console from
web and then again accessing /crowd/auth while being logged - I still getting 'enter credentials' page.
In such situation , when testing twitter - I was not redirected on login page and there was oauth token param proveded in request automatically.

from omniauth_crowd.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.