sorcery icon indicating copy to clipboard operation
sorcery copied to clipboard

Token authentication

Open statiklabs opened this issue 13 years ago • 40 comments

Hi Noam. Great work on the Sorcery gem. Is token authentication something that would find it's way into Sorcery on day?

statiklabs avatar Sep 29 '11 18:09 statiklabs

Yes, it's been asked for a few times. Since v0.7.0 is nearly done, it is set for v0.8.0. The issue will stay here until it's done. Thanks.

NoamB avatar Sep 29 '11 22:09 NoamB

Great to hear. I will keep plugging away with Sorcery then. Look forward to the 0.8.0.0 release!

Thanks for your hard work, making mine easier!

statiklabs avatar Oct 06 '11 02:10 statiklabs

Token authentication would be great for use with mobile app backends and Web Services :)

I'll try and look into this over the weekend. Maybe I can submit a pull request!

Anyway, +1 from me.

theodorton avatar Mar 30 '12 12:03 theodorton

+1

Would love to see this feature, would really make mobile-development easier :)

henningms avatar Mar 30 '12 12:03 henningms

Hi, I'm not getting to it...

I was thinking about an API like this:

require_login :token_allowed => true, :only => [:json]

This way it extends require_login to allow or disallow tokens, and only for specific formats.

I would probably do it in a new submodule.

If anyone wants to 'lift the glove', it shouldn't be much trouble implementing.

On Fri, Mar 30, 2012 at 3:19 PM, Henning M. Stephansen < [email protected]

wrote:

+1

Would love to see this feature, would really make mobile-development easier :)


Reply to this email directly or view it on GitHub: https://github.com/NoamB/sorcery/issues/70#issuecomment-4841349

NoamB avatar Mar 31 '12 10:03 NoamB

Actually require_login has all the options of a before filter, so I shouldn't touch 'only'.

Maybe another before filter, allows_token_authentication.

Not sure. How is it done in other gems?

NoamB avatar Mar 31 '12 10:03 NoamB

Atm I'm building my app in the hope token authentication comes along before I start building my API.

Seeing this feature in there would be a massive +100 from me

philostler avatar Mar 31 '12 10:03 philostler

+1

Authlogic was a good one for this back in the day although it's methodology may be outdated now, I'm not sure: see Single Access Token module and Session Params module

ADO avatar Apr 15 '12 01:04 ADO

I'm thinking this design:

  1. on password creation/update create another field - auth_token
  2. a new before_filter - 'allow_token_authentication' needs to be placed in the controller (along with options like format and allowed actions). This sets some var for this controller, and when 'auto_login' is called under the hood, it will try to login from the auth_token as well.

Also the whole thing might be a new submodule and not in the default.

NoamB avatar Apr 15 '12 05:04 NoamB

That design sounds ideal, only side note I'd say is allowing the auth_token to generated on request by the application as well and not just when the password gets touched.

philostler avatar May 18 '12 10:05 philostler

+1 What do you think about integrate something like this http://railscasts.com/episodes/352-securing-an-api?view=asciicast

grigio avatar Jun 28 '12 11:06 grigio

+1

lephyrius avatar Oct 19 '12 09:10 lephyrius

+1

trnc-ck avatar Dec 12 '12 21:12 trnc-ck

Now that sorcery 0.8.0 has been released how do I use this feature? A tiny example would be nice. :)

lephyrius avatar Jan 13 '13 06:01 lephyrius

I'm curious as to the status of this. Think it's okay to manually implement my own token authentication using authenticate_or_request_with_http_token in my rails-api app in the meantime?

atrauzzi avatar Feb 10 '13 21:02 atrauzzi

I am working on an api using sorcery and this is certainly something I'd love to have.

davidchua avatar Feb 13 '13 09:02 davidchua

Hello everybody, hi Noam.

I just sent a pull request that adds supports for access tokens in RESTful JSON APIs and extends the external submodule to support OAuth 2.0 For Login (client side flow).

https://github.com/NoamB/sorcery/pull/415

I needed this for a pet project that I have been working on my free time, an angularjs app with rails-api as the backend server.

I would really appreciate if you guys could test it, code reviews would be great too.

Support for mongoid and mongomapper is included, but I don't use mongodb so if you plan to use it please do review the code to make sure everything works correctly.

Instructions are in the README.

Let me know what you guys think.

Regards,

fzagarzazu avatar Mar 09 '13 16:03 fzagarzazu

@ fzagarzazu Awesome! +1

Would be nice with a small demo app on github demonstrating this feature :) Cheers!

kristianmandrup avatar Apr 05 '13 17:04 kristianmandrup

I have just published a quick demo with rails-api and OAuth 2.0 for login.

https://github.com/fzagarzazu/sorcery_access_token_demo

Hope it helps, regards,

@kristianmandrup

fzagarzazu avatar Apr 18 '13 05:04 fzagarzazu

+1

mrcwinn avatar Apr 21 '13 14:04 mrcwinn

+1

PapePathe avatar Dec 15 '13 23:12 PapePathe

Any update about it?. +1

ammancilla avatar Dec 23 '13 01:12 ammancilla

I have plans on this feature, but it will probably be in 1.x release.

kirs avatar Dec 23 '13 09:12 kirs

Glad to know that! Thanks for your work.

ammancilla avatar Jan 04 '14 23:01 ammancilla

This was implemented?

nathanpsouza avatar Oct 16 '14 14:10 nathanpsouza

What's the status of this awesome feature?

holden avatar Nov 24 '14 16:11 holden

Three years have passed :) I am sure it will be easier to implement app-specific solution

FUT avatar Dec 16 '14 08:12 FUT

Is token authentication planned for 1.x release?

volisoft avatar Apr 11 '15 10:04 volisoft

Seems that we should use some custom implementation of tokens :)

Mehonoshin avatar Oct 21 '15 13:10 Mehonoshin

hi excelent work. Thanks

I was wondering, if was implemented this feature ?

arjayx avatar May 24 '16 12:05 arjayx