# The best practise of writing the authentication

**URL:** <https://discuss.emberjs.com/t/the-best-practise-of-writing-the-authentication/1113>\
**Category:** Proposals\
**Created:** [April 27, 2013, 9:42am UTC](https://discuss.emberjs.com/t/the-best-practise-of-writing-the-authentication/1113 "2013-04-27T09:42:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geohuz](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@geohuz](https://discuss.emberjs.com/u/geohuz)\
**Post date:** [April 27, 2013, 9:42am UTC](https://discuss.emberjs.com/t/the-best-practise-of-writing-the-authentication/1113/1 "2013-04-27T09:42:51Z")

</div>

I am trying to figure out how to implement authentication using ember.js. I’m currently using python’s pyramid framework as the backend, I’m not sure if I can do the things in ember.js,

1. Setup the global access control data, for example {“view”: [“user1”,“user2”], “edit”:[“user3”]}
2. set a “permission=view/edit” property for any of the url
3. create a “forbidden template (login)” which ember.js could automatically redirect to it when a request goes into the protected url and failed the authentication/authorization check.

Is there any example code for doing the above process? Or anybody has better solution in ember.js.

Thanks

---

<div class="post-metadata">

**Author:** ![lookingsideways](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/lookingsideways/32/13652_2.png) [@lookingsideways](https://discuss.emberjs.com/u/lookingsideways)\
**Post date:** [April 27, 2013, 9:55am UTC](https://discuss.emberjs.com/t/the-best-practise-of-writing-the-authentication/1113/2 "2013-04-27T09:55:16Z")

</div>

[https://github.com/heartsentwined/ember-auth](https://github.com/heartsentwined/ember-auth) covers all of that. It’s worth checking out to get some ideas from if nothing else.

---

<div class="post-metadata">

**Author:** ![geohuz](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@geohuz](https://discuss.emberjs.com/u/geohuz)\
**Post date:** [April 27, 2013, 10:01am UTC](https://discuss.emberjs.com/t/the-best-practise-of-writing-the-authentication/1113/3 "2013-04-27T10:01:36Z")

</div>

I guess the ember-auth answered all my questions. Thanks for point out the resource!
