John,

Did you ever resolve this issue? I'm doing something similar and I'm afraid 
I don't know where to start. Any help you can provide is appreciated.

Thanks,

Linnet

On Wednesday, December 12, 2012 4:20:01 AM UTC-5, John Meiss wrote:
>
> No advice or help to give me?
>
>
>
> On Tuesday, December 11, 2012 6:10:54 PM UTC+1, John Meiss wrote:
>>
>> Hi guys,
>>
>> The application is on an Apache server (front-end) and the back-end with 
>> the WebServices are on a JBoss server.
>> They both should be behind a CAS.
>>
>> I'm thinking about several solutions:
>>
>>    1. Apache mod_cas
>>    2. Add a PHP page with a cas library
>>    3. Full AngularJS solution
>>    
>> I'm more interested about the last solution because:
>>
>>    - It's more Angular way
>>    - Need to improve my Angular skill ;)
>>    - Try to avoid to add one more technology (PHP)
>>
>> To do that, I've read some articles about authentication with AngularJS 
>> but really few of them use CAS.
>> Most of the following code comes from this AMAZING article 
>> http://www.espeo.pl/2012/02/26/authentication-in-angularjs-application 
>> (thank you very much Witold!)
>>
>> So actually I've that:
>> myPortal.config(function($httpProvider) {
>>   function httpInterceptor($q, $log) {
>>     function success(response) {
>>       return response;
>>     }
>>
>>     function error(response) {
>>       var status = response.status;
>>  
>>       if (status == 401) {
>>         $log.error('Response status: ' + status);
>>         window.location = 'http://my-cas-server.com';
>>         return status;
>>       }
>>
>>       return $q.reject(response);
>>     }
>>
>>     return function(promise) {
>>       return promise.then(success, error);
>>     }
>>   }
>>   $httpProvider.responseInterceptors.push(httpInterceptor);
>> });
>>
>>
>> When I run this code, it works, I'm redirected to the CAS sign in page 
>> but my application has already started to be rendered
>> so users can see a part of an empty application which is not acceptable ;)
>>
>> *Questions:*
>>
>>    - First of all, it's the first time that I implement a CAS 
>>    authentication, so do you think that I'm on the good way?
>>    - Would you to this like that or not at all?
>>    - If I'm on the good way, how can I avoid the cloaking?
>>       - I've read several articles and posts like the Misko's post on 
>>       stackoverflow: 
>>       
>> http://stackoverflow.com/questions/11972026/delaying-angularjs-route-change-until-model-loaded-to-prevent-flicker/11972028#11972028
>>  
>>       but I can't get its solution working with this kind of controller:
>>    
>>
>> myPortal.controller('PanelCtrl', function($scope, $rootScope, 
>> $routeParams, Panel) {
>>   $rootScope.$watch('locale', function() {
>>     $scope.panels = Panel.query(function(panels) {
>>       $scope.selected = $routeParams.panelId || panels[0].id;
>>       $rootScope.currentPanel = Panel.get({panelId: $scope.selected});
>>     });
>>   });
>>
>>   $scope.select = function(id) {
>>     $scope.selected = id;
>>   };
>> });
>>
>> Thank you for all kind of help!
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to