Giter Club home page Giter Club logo

Comments (7)

pencil avatar pencil commented on August 19, 2024

As CASino does not have it's own user management, there is no admin page. How did you configure the ActiveRecord authenticator and what does the configured user table look like?

from casinoapp.

kirantpatil avatar kirantpatil commented on August 19, 2024

ActiveRecord authenticator structure:

########################################

SQL (ActiveRecord authenticator)

########################################
my_company_sql_database:
authenticator: "ActiveRecord"
options:
connection:
adapter: "mysql2"
host: "localhost"
username: "dbusername"
password: "dbpass"
database: "xxx_production"
table: "users
username_column: "username"
password_column: "encrypted_password"
extra_attributes:
email: "email"
fullname: "displayname_database_column" --> this line is commented

User table structure:

mysql> desc users;
+------------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| email | varchar(255) | NO | UNI | | |
| encrypted_password | varchar(255) | NO | | | |
| reset_password_token | varchar(255) | YES | UNI | NULL | |
| reset_password_sent_at | datetime | YES | | NULL | |
| remember_created_at | datetime | YES | | NULL | |
| sign_in_count | int(11) | YES | | 0 | |
| current_sign_in_at | datetime | YES | | NULL | |
| last_sign_in_at | datetime | YES | | NULL | |
| current_sign_in_ip | varchar(255) | YES | | NULL | |
| last_sign_in_ip | varchar(255) | YES | | NULL | |
| created_at | datetime | NO | | NULL | |
| updated_at | datetime | NO | | NULL | |
| name | varchar(255) | YES | MUL | NULL | |
| admin | tinyint(1) | NO | MUL | 0 | |
| projects_limit | int(11) | YES | | 10 | |
| skype | varchar(255) | NO | | | |
| linkedin | varchar(255) | NO | | | |
| twitter | varchar(255) | NO | | | |
| authentication_token | varchar(255) | YES | UNI | NULL | |
| theme_id | int(11) | NO | | 1 | |
| bio | varchar(255) | YES | | NULL | |
| failed_attempts | int(11) | YES | | 0 | |
| locked_at | datetime | YES | | NULL | |
| extern_uid | varchar(255) | YES | MUL | NULL | |
| provider | varchar(255) | YES | | NULL | |
| username | varchar(255) | YES | MUL | NULL | |
| can_create_group | tinyint(1) | NO | | 1 | |
| can_create_team | tinyint(1) | NO | | 1 | |
| state | varchar(255) | YES | | NULL | |
| color_scheme_id | int(11) | NO | | 1 | |
| notification_level | int(11) | NO | | 1 | |
| password_expires_at | datetime | YES | | NULL | |
| created_by_id | int(11) | YES | | NULL | |
| avatar | varchar(255) | YES | | NULL | |
| confirmation_token | varchar(255) | YES | UNI | NULL | |
| confirmed_at | datetime | YES | | NULL | |
| confirmation_sent_at | datetime | YES | | NULL | |
| unconfirmed_email | varchar(255) | YES | | NULL | |
+------------------------+--------------+------+-----+---------+----------------+
39 rows in set (0.04 sec)

from casinoapp.

kirantpatil avatar kirantpatil commented on August 19, 2024

one more thing, the db I am using belongs to other application users db

from casinoapp.

kirantpatil avatar kirantpatil commented on August 19, 2024

Earlier production.log file expecting to install gem 'activerecord-mysql2-adapter' and I added it to Gemfile and deployed.

After the gem installation now am seeing below error from production.log file

Connecting to database specified by database.yml
Started POST "/login" for 127.0.0.1 at 2013-12-16 21:00:26 +0400
Processing by CASino::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"D5o9JGVdC79/J+Ldt+xu0F87DL7KrSz2+U9nG4AXA+M=", "lt"=>"LT-13872130550211-ETgwnDZpSodtCJ9GdgS7gfR7poxGBWx2itnICx1M", "username"=>"kiran", "password"=>"[FILTERED]", "button"=>""}
Login ticket 'LT-13872130550211-ETgwnDZpSodtCJ9GdgS7gfR7poxGBWx2itnICx1M' not found
Rendered vendor/bundle/ruby/1.9.1/gems/casino-2.0.2/app/views/casino/application/_messages.html.erb (1.0ms)
Rendered vendor/bundle/ruby/1.9.1/gems/casino-2.0.2/app/views/casino/application/_footer.html.erb (0.6ms)
Rendered vendor/bundle/ruby/1.9.1/gems/casino-2.0.2/app/views/casino/sessions/new.html.erb within layouts/application (42.3ms)
Completed 403 Forbidden in 252.1ms (Views: 81.7ms | ActiveRecord: 14.0ms)
Started POST "/login" for 127.0.0.1 at 2013-12-16 21:00:32 +0400
Processing by CASino::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"D5o9JGVdC79/J+Ldt+xu0F87DL7KrSz2+U9nG4AXA+M=", "lt"=>"LT-13872130550211-ETgwnDZpSodtCJ9GdgS7gfR7poxGBWx2itnICx1M", "username"=>"kiran", "password"=>"[FILTERED]", "button"=>""}
Login ticket 'LT-13872130550211-ETgwnDZpSodtCJ9GdgS7gfR7poxGBWx2itnICx1M' not found
Rendered vendor/bundle/ruby/1.9.1/gems/casino-2.0.2/app/views/casino/application/_messages.html.erb (0.2ms)
Rendered vendor/bundle/ruby/1.9.1/gems/casino-2.0.2/app/views/casino/application/_footer.html.erb (0.1ms)
Rendered vendor/bundle/ruby/1.9.1/gems/casino-2.0.2/app/views/casino/sessions/new.html.erb within layouts/application (3.1ms)
Completed 403 Forbidden in 12.1ms (Views: 5.1ms | ActiveRecord: 3.2ms)
Started POST "/login" for 127.0.0.1 at 2013-12-16 21:00:40 +0400
Processing by CASino::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"D5o9JGVdC79/J+Ldt+xu0F87DL7KrSz2+U9nG4AXA+M=", "lt"=>"LT-13872132324592-xKCT7YOUNJ3KP0slpGOrO7GUAoM7hy8vHy3zktaK", "username"=>"kiran", "password"=>"[FILTERED]", "button"=>""}
Completed 500 Internal Server Error in 434.3ms

NoMethodError (undefined method accept' for nil:NilClass): vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/database_statements.rb:7:into_sql'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in select_all' vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/query_cache.rb:63:inselect_all'

from casinoapp.

kirantpatil avatar kirantpatil commented on August 19, 2024

I am using postgresql for the database in database.yml file.

from casinoapp.

kirantpatil avatar kirantpatil commented on August 19, 2024

I removed activerecord-msql2-authenticator and added mysql2 again in the Gemfile apart from mysql group entry and did bundle install

I am able to login with the user of other app db which is mentioned in SQL authenticator.

from casinoapp.

bnmagat avatar bnmagat commented on August 19, 2024

Hi! I'm having the same problem here. I'm new to rails and I've found this CASino very useful with my applications. However, I'm having a problem logging in to CASino. I have an existing database "wiz_common_master" which is connected to my applications for the login.

I think I have migrated CASino successfully in this database since there were these casino__ tables. But I don't know how CASino gets the login username and password from my database.

Here is my database.yml

  database: wiz_common_master
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: Inhouse2012
  socket: /var/lib/mysql/mysql.sock 

And my cas.yml

  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
  authenticators:
    my_company_sql_database:
      authenticator: "ActiveRecord"
      options:
       connection:
        adapter: "mysql2"
        host: "localhost"
        username: "root"
        password: "Inhouse2012"
        database: "wiz_common_master"
       table: "m_logins"
       username_column: "login"
       password_column: "crypted_password"
        extra_attributes:
          employee_id: "m_employee_id"
          login_name: "login" 

Here are my database's tables:

mysql> show tables;
+----------------------------------+
| Tables_in_wiz_common_master      |
+----------------------------------+
| casino_auth_token_tickets        |
| casino_login_attempts            |
| casino_login_tickets             |
| casino_proxy_granting_tickets    |
| casino_proxy_tickets             |
| casino_service_rules             |
| casino_service_tickets           |
| casino_ticket_granting_tickets   |
| casino_two_factor_authenticators |
| casino_users                     |
| m_calendar_items                 |
| m_calendars                      |
| m_class_users                    |
| m_classes                        |
| m_corporations                   |
| m_employee_histories             |
| m_employees                      |
| m_ic_cards                       |
| m_logins                         |
| m_official_posts                 |
| m_premium_rates                  |
| m_section_users                  |
| m_sections                       |
| m_user_data                      |
| schema_migrations                |
+----------------------------------+
25 rows in set (0.00 sec)

And my m_logins table:

mysql> desc m_logins;
+------------------+-------------+------+-----+-------------------+----------------+
| Field            | Type        | Null | Key | Default           | Extra          |
+------------------+-------------+------+-----+-------------------+----------------+
| id               | int(11)     | NO   | PRI | NULL              | auto_increment |
| login            | varchar(40) | NO   |     | NULL              |                |
| crypted_password | varchar(40) | YES  |     | NULL              |                |
| salt             | varchar(40) | YES  |     | NULL              |                |
| m_employee_id    | int(11)     | NO   |     | NULL              |                |
| created_by       | int(11)     | YES  |     | NULL              |                |
| created_at       | datetime    | NO   |     | CURRENT_TIMESTAMP |                |
| deleted_by       | int(11)     | YES  |     | NULL              |                |
| deleted_at       | datetime    | YES  |     | NULL              |                |
+------------------+-------------+------+-----+-------------------+----------------+
9 rows in set (0.00 sec)

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.