Live data from Hacker News

Show HN: Satellizer – Authentication for AngularJS

github.com

21–30 of 38 posts

Re: Show HN: Satellizer – Authentication for AngularJS

#21
post #20
post #7

This is a very nice solution and API for the front-end. It took me a couple part-time months to put together a similar (not modularized) solution for a rewrite of Plunker. There is quite a bit of juggling of information to do to pass around the appropriate information between client, server and auth providers that seems to have been nicely abstracted. There were three major challenges for me in my implementation and…

The account merging part is something your server should handle. In my app I maintain a users table that has columns (google_account_id, facebook_account_id, twitter_account_id, etc), pointing to individual rows in a separate accounts tables (e.g. google_accounts, facebook_accounts, twitter_accounts etc). When a user adds an existing account_id, I take care of merging the two different users rows, populating appropri…

You could create an identities table which consists of a provider and a uid where Users have many identities. Something similar to this:

https://github.com/intridea/omniauth/wiki/Managing-Multiple-...

Use what works for you obviously, but this would have the benefit of scaling easier if you end up ever needing to support additional providers.

Re: Show HN: Satellizer – Authentication for AngularJS

#25
post #20
post #7

This is a very nice solution and API for the front-end. It took me a couple part-time months to put together a similar (not modularized) solution for a rewrite of Plunker. There is quite a bit of juggling of information to do to pass around the appropriate information between client, server and auth providers that seems to have been nicely abstracted. There were three major challenges for me in my implementation and…

The account merging part is something your server should handle. In my app I maintain a users table that has columns (google_account_id, facebook_account_id, twitter_account_id, etc), pointing to individual rows in a separate accounts tables (e.g. google_accounts, facebook_accounts, twitter_accounts etc). When a user adds an existing account_id, I take care of merging the two different users rows, populating appropri…

Thanks for the reply. That is the approach I take. Users have one or more identities which seems to be the logical way of handling this regardless of the physical structure used to store the association.

While you gloss over it a bit, the 'migrate the existing data' part is a challenge of its own because it means that suddenly the auth component needs to either know every place where a usercontent association is made or you need some sort of queue set up to publish user merges to all parts of the app in a reliable and durable way so that they can process the migration themselves.

I would say that this is also a UI concern and therefore something that a service like this would need to handle because it should _not happen automatically_. When a user conflict is detected, the user should be able to make a decision via appropriate UI. We would not want two accounts being merged simply because of some degenerate case where someone logged into their account on a borrowed computer.

Re: Show HN: Satellizer – Authentication for AngularJS

#26
I tried implementing a token-based authentication system, and it worked fine for a while. Then we added a subdomain (login.mysite.com) for registering, and it all went to shit. They don't share the same localStorage, so keeping the tokens in sync can be tough.

Re: Show HN: Satellizer – Authentication for AngularJS

#27

I tried implementing a token-based authentication system, and it worked fine for a while. Then we added a subdomain (login.mysite.com) for registering, and it all went to shit. They don't share the same localStorage, so keeping the tokens in sync can be tough.

Does it have to be a subdomain? Few people pay attention to whether they're logging in to login.mysite.com or mysite.com/login The few times I've tried to guess a web page's login address, I've tried both a login subdomain and a login directory.

Re: Show HN: Satellizer – Authentication for AngularJS

#28
This is a very, very nice project -- almost enough to pull me back from ReactJS back to AngularJS. Almost.

One question: they say it can be adapted to any Oauth1 or 2 provider, but doesn't the Oauth 2 provider have to support the Implicit Flow for this type of client-side app to work?

If so, is it true that Github doesn't support Implicit flow? (this is what I've read, and I've not found much on the web otherwise about what exact oauth flows Github supports)

Re: Show HN: Satellizer – Authentication for AngularJS

#29
post #14

How easy is this to use without AngularJS? Additionally, if not, does anyone know of any alternative JS (or perhaps Python) libraries for what Satellizer does?

Satellizer is tightly coupled with Angular so I don't think there is much sense in using it without Angular. You can certaintly take server-side examples and re-implement satellizer.js in pure JavaScript but that is going to be a lot of work! The closest non-Angular alternative that I know of would be Torii (https://github.com/Vestorly/torii/)

Re: Show HN: Satellizer – Authentication for AngularJS

#30

I tried logging in with Twitter and wasn't redirected back to your app, so I wasn't able to log in. (Latest Chrome on OSX)

I forgot to change the redirect url on dev.twitter.com from http://127.0.0.1:3000 to http://satellizer.herokuapp.com. It should be fixed now.
Post reply on HN