What version of Ember-Simple-Auth should I use?

Hello everyone,

I am considering EmberJS for my next project and the number one thing it needs is solid authentication. After lots of searching around I found Ember-Simple-Auth. In my noob mind it looks good.

However, I am being asked to decide which of the 12 versions I would like to use: https://github.com/simplabs/ember-simple-auth/releases

I don’t know how to answer that but am hoping someone here can guide me. Here is my situation:

I have an Azure Mobile Service REST/API that I want to require authentication for before a person can pull data.

I would like to be able to put encrypted values/tokens in the header to read when a request is made.

I think that’s it; pretty simple. So which release is right for me?

Or should I be doing something completely different?

Thank you.

Why don’t use the latest one if you have no particular reason?

Sorry, let me rephrase the question.

On this page / paragraph: https://github.com/simplabs/ember-simple-auth#other-options

It says “Download a prebuilt version from the releases page

There are twelve things (prebuilt “versions”) to download there. That is what I am referring to.

Thank you.

honestly, I had my own difficulties with deciding which of those packages is the correct one for me. I ended up downloading the normal one, e.g. “ember-simple-auth-0.7.1.js” without anything fancy and included the js file in my index.html…

But you do yourself a big favour if you start your project with ember cli from the beginning and just don’t worry about this manually including libraries any more but install a library like ember-simple-auth with just npm install --save-dev ember-cli-simple-auth

1 Like

TO what I know, AMD version is for requireJS, whereas normal one is for CommonsJS, a way to export modules.

Beware that cookies-auth, devise, troil, are extension library. You may need to include the extension library in order to work it well. To me at least, two files need to download (Ember-simple-auth + Devise one ) . It works like a charm :slight_smile:

Thank you both for your help.

So here is where I am with my first Ember project.


What I Did

I went to http://www.ember-cli.com/ and did the “Getting Started”. The app started and displayed “Welcome to Ember.js”.

Out of the box there is an error in the console:

Could not find “index” template or view. Nothing will be rendered Object {fullName: “template:index”}

Next I ran the following:

npm install --save ember-cli-simple-auth

bower install ember-addons.bs_for_ember --save

And added the following to index.html before the vendor.js script:

<script src="/vendor/ember-addons.bs_for_ember/dist/js/bs-core.min.js"></script> 
<script src="/vendor/ember-addons.bs_for_ember/dist/js/bs-alert.min.js"></script>

Two Problems:

Ember Simple Auth says in the console:

No authorizer was configured for Ember Simple Auth - specify one if backend requests need to be authorized.

This may just be a matter of finding the documentation on setting up the configuration.

But after adding the bootstrap stuff the console has this (note: http was intentionally munged since the forum says I’m too noob to add more links):

GET httx://localhost:4200/vendor/bootstrap/dist/css/bootstrap.css

GET httx://localhost:4200/vendor/ember-addons.bs_for_ember/dist/js/bs-core.min.js

GET httx://localhost:4200/vendor/ember-addons.bs_for_ember/dist/js/bs-alert.min.js

I thought I followed the directions accurately but I’ll have to double check.

Thanks again for your help.

  • You don’t have to do this in the index.html anymore, it’ll already be included. ember-simple-auth (installed with ember cli) only needs a initializer. Follow the guid on ember simple auth - how to use closely.
  • You don’t really touch the index.html anymore, you would include stuff within the Brocfile.js.
  • Ember cli is definitely not a piece of cake, it took me quite a while and it also required me to reread parts of the documentation again and again until I really understood what they wanted. Following the conventions of ember cli and their guide is crucial.
  • This is not an error, just a debug information

  • Try implementing one thing at a time, adding ember-simple-auth and bootstrap simultaneously is only vanishing where errors actually come from and give you a harder time, one step at a time.

Thank you for the good information @Preexo.

I deleted the entire folder and started over. I followed the step-by-step directions here http://ember-simple-auth.simplabs.com/ and it worked the first time. Amazing.

However, this has brought up another question which I think I’ll start a new thread for. But I’m going to read that simple auth link you posted and see if it answer my question first.

Thanks!

1 Like