-
-
Save tiposaurio/a66fc96a9bb0c3ba5b96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //html de invocacion | |
| <button type="button" class="btn btn-default" ng-click="login()"> | |
| <i class="fa fa-fw fa-sign-in"></i> Log in | |
| </button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Definicion del login controller | |
| .controller( 'LoginController', [ | |
| '$scope', '$auth', | |
| function ( $scope, $auth ) { | |
| $scope.login = function () { | |
| if ( !$auth.isAuthenticated() ) { | |
| $auth.authenticate('sso') | |
| } | |
| }; | |
| }]); | |
| //Configuracion del proveedor de oauth2 | |
| app.config([ '$authProvider', function ( $authProvider ) { | |
| $authProvider.oauth2({ | |
| name: 'sso', | |
| url: 'auth', | |
| scope: ['read', 'write', 'trust'], | |
| scopeDelimiter: ',', | |
| requiredUrlParams: ['scope'], | |
| redirectUri: location.origin + location.pathname + '#/calculator', | |
| clientId: 'pagos_cliente', | |
| authorizationEndpoint: 'http://localhost:8080/sso/oauth/authorize' | |
| }); | |
| }]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment