Skip to content

Instantly share code, notes, and snippets.

@tiposaurio
Forked from anonymous/login view
Last active August 29, 2015 14:18
Show Gist options
  • Save tiposaurio/a66fc96a9bb0c3ba5b96 to your computer and use it in GitHub Desktop.
Save tiposaurio/a66fc96a9bb0c3ba5b96 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Apr 10, 2015.
    4 changes: 4 additions & 0 deletions login view
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    //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>
    28 changes: 28 additions & 0 deletions satellizer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    // 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'
    });
    }]);