JamesRandall / AngularJS-OAuth2

Package for allowing an AngularJS application to authenticate with an OAuth 2 / Open ID Connect identity provider using the implicit flow.
MIT License
46 stars 42 forks source link

Silent token renewal #21

Closed ciaranj closed 8 years ago

ciaranj commented 8 years ago

HI there,

I've done some work to extend your directive to support silent token renewal. The approach leans a little (the renewTokenSilently method) on the approach that ThinkTecture provide in their OIDC sample libraries (https://github.com/IdentityServer/IdentityServer3.Samples/blob/master/source/Clients/JavaScriptImplicitClient/oidc.js) which is Apache licensed, since you framed this library as being a client for IdentityServerv3 originally I figured that would be ok?

JamesRandall commented 8 years ago

Thanks for this - and apologies it's taken me a while to pick up on it. Been on a bit of a break. I'm just making a couple of simple tweaks at the moment and when that's done I'll look to merge this in.

ciaranj commented 8 years ago

No worries ;)

ciaranj commented 8 years ago

Any joy with this :)

JamesRandall commented 8 years ago

Hi - just not had a chance yet as pretty busy with the day job. I've merged a couple of minor fixes but this is a bit more substantial!

ciaranj commented 8 years ago

;) I understand, the PRs just keep backing up on my own projects too!

ciaranj commented 8 years ago

Hiyah, i've rebased this work against master again ;)

JamesRandall commented 8 years ago

Thank you - I should be looking at this in the next week or so as I'm putting in place an STS that requires token renewal support and this library updating to do that.

JamesRandall commented 8 years ago

Many many thanks for this. I've spent a couple of hours reviewing and testing it in a fairly complex Angular app and it works great.

In the morning I'm going to add a readme.md in the morning documenting the existing functionality and this addition and then I'll bump the bower version to 1.1.0 and release.

Thanks again - really appreciated.

ciaranj commented 8 years ago

No worries, I've tested in my side too (admittedly more pre the recent rebase) and yes I've tried to document the behaviour completely in the commit message, so I definitely think documenting the functionality clearly would help, because it's a fiddly blighter ;)

JamesRandall commented 8 years ago

And done. Documentation always takes longer than you think! Thanks again for your help.