angular-oauth2AngularJS 的 OAuth2 模块
angular-oauth2 是 AngularJS 的 OAuth2 认证模块,使用 ES6 编写。
使用方法:
1. 引入 js 库:
<script src="bower_components/angular/angular.min.js"></script> <script src="bower_components/angular-cookie/dist/angular-cookie.min.js"></script> <script src="bower_components/query-string/query-string.min.js"></script> <script src="bower_components/angular-oauth2/dist/angular-oauth2.min.js"></script>
2. 配置 OAuth 和 OAuthToken
angular.module('myApp', ['angular-oauth2']) .config(['OAuthProvider', function(OAuthProvider) { OAuthProvider.configure({ baseUrl: 'https://api.website.com', clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', }); }]);
3. 错误处理:
angular.module('myApp', ['angular-oauth2']) .run(['$rootScope', '$window', function($rootScope, $window) { $rootScope.$on('oauth:error', function(event, rejection) { // Ignore `invalid_grant` error - should be catched on `LoginController`. if ('invalid_grant' === rejection.data.error) { return; } // Redirect to `/login` with the `error_reason`. return $window.location.href = '/login?error_reason=' + rejection.data.error; }); }]);
评论
YMP-OAuth基于 YMP 框架实现的 OAuth2 授权服务模块
OAuth基于YMP框架实现的OAuth2授权服务模块;Maven包依赖 net.ymate.
YMP-OAuth基于 YMP 框架实现的 OAuth2 授权服务模块
0
YMP-OAuth基于 YMP 框架实现的 OAuth2 授权服务模块
OAuth基于YMP框架实现的OAuth2授权服务模块;Maven包依赖net.ymate.moduleymate-module-oauth1.0-SNAPSHOT模块配置参数说明#---------
YMP-OAuth基于 YMP 框架实现的 OAuth2 授权服务模块
0
IdentityServer4.Net 平台下的 OAuth2 组件
IdentityServer4 .Net平台下的OAuth2组件,github上的关注度不低于Dot
IdentityServer4.Net 平台下的 OAuth2 组件
0
liboauth2python oauth2 客户端
liboauth2 是一个轻量级的oauth2 python客户端。liboauth2 只是实现oa
liboauth2python oauth2 客户端
0
aerogear-ios-oauth2基于 aerogear-ios-http 的 OAuth2 客户端
aerogear-ios-oauth2 是基于 aerogear-ios-http 的 OAuth2
aerogear-ios-oauth2基于 aerogear-ios-http 的 OAuth2 客户端
0