¿Por qué Ember-Simple-Auth admite tokens de actualización? (JS + OAuth 2.0)

From what I've read in the OAuth 2.0 specs so far, it is not recommended to store any confidential information in the browser where it would be accessible via Javascript.

The discussion here also seems to agree on this point: Using OAuth2 in HTML5 Web App

I am currently building an Ember-based app as a frontend to my REST-style API backend, and I am using Ember-Simple-Auth as a library for handling the user login, which implements the Resource Owner Password Credentials workflow and also explicitly supports refresh tokens.

Leí que el "Resource Owner Password Credentials" grant type in OAuth 2.0 allows the usage of refresh tokes, but the text in this paragraph is written addressing a very general definition of client.

As Ember.js is a framework for writing single page webapps running in the browser, I am now wondering...

Would it be safe to use the refresh token in an Ember app? The discussion mentioned above seems to disagree. Which leads me to:

Why does Ember-Simple-Auth support refresh tokens?

Thanks for taking the time to consider. Best! Marcus

preguntado el 28 de mayo de 14 a las 14:05

1 Respuestas

The only point where using a refresh token is less safe than not using one is when the refresh token doesn't expire. So if someone gets physical access to your machine (or sth. is broken wrt HTTPS), the access token might already have been expired while the refresh token is still active and can be used to obtain fresh access tokens (meaning the security hole stays forever).

Support for that was built into Ember.SimpleAuth by popular demand. There are 2 things to say about it though: besides from the user heaving to make sure no one gets physical access to their machines (which is a required security strategy for most sites as no sites usually expire sessions or only after very long time) it's vital that client and server only communicate via (correctly set up) HTTPS. The second thing is that Ember.SimpleAuth only uses a refresh token when there's one in the server response. So if your'e concerned about that (which in my opinion is right) don't enable refresh tokens on the server side in the first place.

contestado el 28 de mayo de 14 a las 16:05

Thanks for the clarification! I think it would help to put some of these thoughts into the documentation. As far as I understand the OAuth specs, refresh tokens are supposed to be far more long-lived than access tokens, so it might actually turn out to be a concern. I am including refresh tokens for other server based apps and (now that I know) I will not use refresh tokens for the Ember app. - mphasize

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.