Comments (3)
As CASino does not support user creation (sign up), only login (sign in), I assume you want to do this in another app. You can use the API to sign the new user in, check #38 and #40 for an example.
from casino.
I'm reusing LoginCredentialAcceptor
to auto login users. In my case users are signing up with Devise, after sign up they are redirected to an action I built in UsersController#sign_in
.
This action receives username
and password
as get parameters , and deal with LoginCredentialAcceptor
to login the signed up user.
I also had to include CASino::ProcessorConcern::LoginTickets
in the top of the controller.
from casino.
For future visitors, here's a more up-to-date example using the ActiveRecord authenticator:
class RegistrationsController < Devise::RegistrationsController
include CASino::SessionsHelper
private
def sign_up(resource_name, resource)
return unless params.has_key?(:service)
data = { authenticator: 'ActiveRecord', user_data: { username: resource.email }}
sign_in(data)
end
# Prevents render/redirect conflicts between Devise & CASino, also makes the
# service_with_ticket_url available for Devise to follow after registration.
def handle_signed_in_with_service(tgt, options)
if !service_allowed?(params[:service])
@service = params[:service]
render 'casino/sessions/service_not_allowed', status: 403
else
@url = acquire_service_ticket(tgt, params[:service], options).service_with_ticket_url
end
end
def after_sign_up_path_for(resource)
params.has_key?(:service) ? @url : super
end
end
In order for this to work you'll need to ensure the service
param is forwarded through the registration pipeline (e.g., registration link on the login page and the following registration form tag). I'm sure this example can be improved but it should give you a decent starting point.
Edit: Make sure you're only passing params[:service]
and and not the entire params hash in your devise links/form tags. Otherwise you'll break devise as your params hash content will override anything you enter into the forms.
from casino.
Related Issues (20)
- Rails 5 support! HOT 6
- How CAS server identify differency domain name HOT 4
- LDAP and ActiveRecord have different extra_attributes
- Login with ember.js app and JWT API HOT 1
- Password Recovery option? HOT 1
- Net timeout error when trying to sign in. HOT 1
- Cannot login to CASino: Gives me 403 Forbidden HOT 26
- hi bro..
- CASino ActiveRecord Authentication HOT 2
- Trying to install CASino App. Experiencing bundle exec rake db:migrate issues.
- Resurrecting SAML2 Integration with CASino #94
- User connexion problem
- Mongo for storing schema
- interest in maintainer help? HOT 16
- CASino integration with mobile apps HOT 1
- always getting Incorrect username or password. HOT 1
- CASino integration to several folder in AD using LDAP
- how to create a new user where is sign up ?
- How can we make salted md5, sha 256 or sha 512, compatible with CASino's ActiveRecord? HOT 1
- Rails 4.2 Asset Pipeline issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from casino.