【发布时间】:2015-09-10 07:14:03
【问题描述】:
如何向 AngularJS 和 ui.router 添加授权? 我正在使用 modulg ng-oauth https://github.com/andreareginato/oauth-ng
我可以使用页面http://andreareginato.github.io/oauth-ng/中的以下示例吗?
$scope.$on('oauth:login', function(event, token) {
console.log('Authorized third party app with token', token.access_token);
});
$scope.$on('oauth:logout', function(event) {
console.log('The user has signed out');
});
$scope.$on('oauth:loggedOut', function(event) {
console.log('The user is not signed in');
});
$scope.$on('oauth:denied', function(event) {
console.log('The user did not authorize the third party app');
});
$scope.$on('oauth:expired', function(event) {
console.log('The access token is expired. Please refresh.');
});
$scope.$on('oauth:profile', function(profile) {
console.log('User profile data retrieved: ', profile);
});
谢谢, 西蒙
【问题讨论】:
标签: javascript angularjs oauth angular-ui-router