Last active Feb 13, 2019

oauth2 Implicit Grant authenticator for ember-simple-auth

This is a sample ember-simple-auth authenticator implementation for the oauth2 Implicit Grant which implements "silent reauthentication" (fetching a new token from the IDP via the prompt=none flow). It also uses ember-master-tab to run the refresh process in only a single tab (if the application is open in multiple tabs); at time of writing, it's necessary to use the master branch rather than the version published to npm as it makes use of a recent change to try to recover from the master tab crashing (as opposed to being closed cleanly).

This implementation also expects the token to be a JWT; you may need to adjust the token-related parts if you're not using JWTs.

So how do I use this?

This gist is not a fully developed, drop-in, ready-to-use implementation. It's intended as a starting point for your own implementation, so you'll need to do some work yourself to use it - including (but not necessarily limited to):

Add ember-master-tab to your Ember project, if you're not already using it

Switch to the master branch if you're running v1.0.0 or earlier

Add the files in this gist (excluding this readme) to the indicated locations in your Ember app

Strip out the comment from the top of silent-callback.html - it's just there to tell you where to put the file

You may also want to remove the filename comments from the other files, but they're not critical