Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to sign in a user programmatically, without password?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Misha Manulis  
View profile  
 More options Feb 27 2012, 8:26 pm
From: Misha Manulis <mich...@manulis.com>
Date: Mon, 27 Feb 2012 17:26:17 -0800 (PST)
Local: Mon, Feb 27 2012 8:26 pm
Subject: How to sign in a user programmatically, without password?

I'm working on integrating Clearance with Omniauth and I'm struggling
trying to figure out how to sign a user in, after (s)he has signed in via
Omniauth.

I've tried using sign_in function and passing an instance of the user, but
after I redirect_to root_path current_user is not set.

I've tried setting the current user directly, but that's not helping either.

Looking through the code, I see a sign_in method, but I'm not sure how to
get access to the sessions controller to call it.  The test helpers refer
to @controller instance, but which controller?

What's the correct way of integrating Clearance with Omniauth?  Is there a
tutorial/doc on how to do this?

Thank you,

Misha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Croak  
View profile  
 More options Feb 28 2012, 1:12 pm
From: Dan Croak <dcr...@thoughtbot.com>
Date: Tue, 28 Feb 2012 13:12:53 -0500
Local: Tues, Feb 28 2012 1:12 pm
Subject: Re: [Clearance] How to sign in a user programmatically, without password?
Hi Misha,

Can you share more of your code? Maybe using http://gist.github.com?

Clearance should be able to play nicely with Omniauth. Read this file
to get a sense of how Clearance interacts with sessions:

https://github.com/thoughtbot/clearance/blob/master/lib/clearance/aut...

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Misha Manulis  
View profile  
 More options Mar 2 2012, 12:03 am
From: Misha Manulis <mich...@manulis.com>
Date: Thu, 1 Mar 2012 21:03:35 -0800 (PST)
Local: Fri, Mar 2 2012 12:03 am
Subject: Re: [Clearance] How to sign in a user programmatically, without password?

Hi Dan,

I was following the example from Ryan Bates railscast for Omniauth, parts 1
and 2.  He uses Devise for his example and I was adapting it to Clearance.

In his example, he creates an Authorizations controller.  When the provider
calls the callback URL, there's a route to catch it and send it to the
create action in Authorizations controller.

The create action does a bunch of checks about whether or not the user
needs to be registered and at the end, signs him/her in.

Devise uses sign_in_and_redirect call and in Clearance I found sign_in
function which I assumed does the same as what Devise implements, minus the
redirect.

You can see my implementation of the create action here
https://gist.github.com/1955811

After the redirect current_user is empty.

What am I doing wrong?

Thank you

Omniauth Railscasts:
http://railscasts.com/episodes/235-omniauth-part-1
http://railscasts.com/episodes/236-omniauth-part-2


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Croak  
View profile  
 More options Mar 2 2012, 10:44 am
From: Dan Croak <dcr...@thoughtbot.com>
Date: Fri, 2 Mar 2012 10:44:46 -0500
Local: Fri, Mar 2 2012 10:44 am
Subject: Re: [Clearance] How to sign in a user programmatically, without password?
Misha,

Here is what I did the last time I used Clearance with Omniauth (Facebook only):

https://gist.github.com/88558b3ae6c5bc41cdae

Does that help?

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Misha Manulis  
View profile  
 More options Mar 2 2012, 4:13 pm
From: Misha Manulis <mich...@manulis.com>
Date: Fri, 2 Mar 2012 13:13:07 -0800 (PST)
Local: Fri, Mar 2 2012 4:13 pm
Subject: Re: [Clearance] How to sign in a user programmatically, without password?

This is great, thank you very much.

- Misha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »