Giter Club home page Giter Club logo

Comments (10)

calmyournerves avatar calmyournerves commented on August 19, 2024

Hey @asjuwel!
Please provide some more details about the problems you're facing.

from casinoapp.

asjuwel avatar asjuwel commented on August 19, 2024

thank's for reply
i create a user table and this contain user_name and password field . now i want to log in with this user_name and password. also using casino

from casinoapp.

pencil avatar pencil commented on August 19, 2024

Please post your cas.yml (with sensitive information blanked out).

from casinoapp.

asjuwel avatar asjuwel commented on August 19, 2024

Hey @pencil my cas.yml contain

defaults: &defaults
  login_ticket:
    lifetime: 600
  service_ticket:
    lifetime_unconsumed: 300
    lifetime_consumed: 86400
  proxy_ticket:
    lifetime_unconsumed: 300
    lifetime_consumed: 86400
  frontend:
    sso_name: "CASino"
    footer_text: "Powered by <a href=\"http://rbcas.com/\">CASino</a>"

development:
  <<: *defaults
  my_user_database:
    authenticator: "ActiveRecord"
    options:
      connection:
        adapter: "mysql2"
        host: "127.0.0.1"
        username: "root"
        password: "123456"
        database: "sampledb"
    table: "users"
    username_column: "user_name"
    password_column: "password"
    extra_attributes:
        email: "email"
        fullname: "first_name"

test:
  <<: *defaults
  authenticators:
    static:
      class: "CASino::StaticAuthenticator"
      options:
        users:
          admin:
            password: "123"

production:
  <<: *defaults
  authenticators:
    my_company_ldap:
      authenticator: "ldap"
      options:
        host: "localhost"
        port: 12445
        base: "dc=users,dc=example.com"
        username_attribute: "uid"
        encryption: "simple_tls"
        extra_attributes:
          email: "mail"
          fullname: "displayname"

from casinoapp.

pencil avatar pencil commented on August 19, 2024

From what I see you added the ActiveRecord authenticator in the development section. Is your application server running in the development environment? How did you encrypt the password in the password column? Try to login with RAILS_ENV=development bundle exec rake casino:authentication:test from the directory where you installed CASino and post the output here.

from casinoapp.

asjuwel avatar asjuwel commented on August 19, 2024

The following error was shown, I then installed casino_core-authenticator-activerecord, but now two versions of activerecord is conflicting. Can you suggest something, I just need to authenticate against my users table.
I created the password using
bundle exec ruby -rbcrypt 'put BCrypt::password.create("123")'
Auth test error

rake aborted!
 LoadError: Failed to load authenticator 'ActiveRecord'. Maybe you have to include "gem 'casino-active_record_authenticator
'" in your Gemfile?
  Error: cannot load such file -- casino-active_record_authenticator
/home/juwel/.gem/ruby/gems/casino-3.0.4/app/processors/casino/processor_concern/authentication.rb:60:in `rescue in load_au
thenticator'
/home/juwel/.gem/ruby/gems/casino-3.0.4/app/processors/casino/processor_concern/authentication.rb:56:in `load_authenticato
r'
/home/juwel/.gem/ruby/gems/casino-3.0.4/app/processors/casino/processor_concern/authentication.rb:30:in `block in authenti
cators'
/home/juwel/.gem/ruby/gems/casino-3.0.4/app/processors/casino/processor_concern/authentication.rb:24:in `each'
/home/juwel/.gem/ruby/gems/casino-3.0.4/app/processors/casino/processor_concern/authentication.rb:24:in `authenticators'
/home/juwel/.gem/ruby/gems/casino-3.0.4/lib/casino/tasks/authentication.rake:13:in `block (3 levels) in '
Tasks: TOP => casino:authentication:test
(See full trace by running task with --trace)

After installing casino_core-authenticator-activerecord

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    casino_core-authenticator-activerecord (>= 0) ruby depends on
      activerecord (~> 3.2.12) ruby
    rails (>= 0) ruby depends on
      activerecord (4.1.8)

from casinoapp.

luxflux avatar luxflux commented on August 19, 2024

It looks like casino_core-authenticator-activerecord is not installed. To ensure the it gets installed and loaded upon starting CASinoApp, add casino_core-authenticator-activerecord to your installation as follows:

  1. Add casino_core-authenticator-activerecord to your Gemfile
  2. Run bundle install

Afterwards, always use bundle exec to wrap any of your rake commands.

Could you post the output of RAILS_ENV=development bundle exec rake casino:authentication:test again after following the steps above? Please use a code block (Howto) to ensure readability of the output.

from casinoapp.

asjuwel avatar asjuwel commented on August 19, 2024

I already added casino_core-authenticator-activerecord on my Gemfile, when I run bundle install then following error is shown.

   Bundler could not find compatible versions for gem "activerecord":In Gemfile: 
   casino_core-authenticator-activerecord (>= 0) ruby depends on
     activerecord (~> 3.2.12) ruby
   rails (>= 0) ruby depends on
     activerecord (4.1.8)

from casinoapp.

luxflux avatar luxflux commented on August 19, 2024

Oh well, you are using an old Gem which does not have Rails 4 support. The authenticator would be casino-activerecord_authenticator. I just checked and you don't have to add the gem by yourself as it is already in the Gemfile. I'm sorry to lead you in the wrong direction.

So please remove it from your Gemfile and run bundle install again.

When you ran the authentication test, did you prefix it with bundle exec?

from casinoapp.

pencil avatar pencil commented on August 19, 2024

If you install CASinoApp as described in the official documentation everything should work out of the box as it includes casino-activerecord_authenticator which is the successor to casino_core-activerecord_authenticator.

from casinoapp.

Related Issues (20)

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.