angularjs-oauth / oauth-ng

AngularJS directive for the OAuth 2.0 Implicit Flow
http://angularjs-oauth.github.io/oauth-ng/
MIT License
364 stars 156 forks source link

Add logout capability. Add session validity checking feature. #116

Closed bramski closed 8 years ago

bramski commented 8 years ago

Overview: This will add two new params to the directive configuration..

logout-path session-path

Session Path When set, compilation of the directive will fire a request to the oauth server to check validity of the session. Users who use this configuration may listen for the oauth:valid check to inform them if the user's session is still valid. This is very helpful when re-opening an older session to ensure that the token the user has in session storage is still valid OR that they haven't purged their session(s) from some other system. If the session is invalid, oauth:invalid will be fired. You may use that callback to logout the user or do any other house keeping as necessary for your application.

Logout Path The logout path adds a logout to redirect to when the user clicks to "logout". It is used by calling Endpoint.logout() if you wish to log out the user manually, and this will trigger a browser redirect.

bramski commented 8 years ago

Noteably this also adds the ability to updateExpiry on the AccessToken.

m00s commented 8 years ago

@bramski Awesome, gonna merge it! Thanks

bramski commented 8 years ago

Thanks @m00s ! Please let me know when you cut a release with this version. My team would like to get back onto the stable version.

m00s commented 8 years ago

@bramski v0.4.7 is out

faraway commented 8 years ago

@bramski Just curious, while the checkValidity being a very nice feature, is it in the OAuth2 spec ? It seems it largely depends on the server side(IdP) implementation(e.g. the response format). Is it correct ?