Home stateParams is empty in firefox
Reply: 0

stateParams is empty in firefox

user1241 Published in April 20, 2018, 10:50 am

My angular app has a workflow for SAML authentication. When you go to the app if you are not authenticated you go to the login controller that looks something like this:

function loginCtrl($scope, $stateParams, $state) {
    if(!angular.isDefined($stateParams.saml) {
        $scope.ssoEnabled ? $state.go('login_manual') : $state.go('login_sso');
    } else {
        var credentials = JSON.parse(btoa($stateParams.saml)); 
        // Handle authentication from the credentials that saml returned

function ssoCtrl($window) {
    if($scope.ssoType === 'saml') {
        $window.location.href = 'https://my_saml_landing_page.php?return_to=' + encodeUriComponent('https://my_app/#/login');

The landing page

// ... do all the stuff to authenticate the user, return the expected response in an object
$cred = base64_encode(json_encode($cred));
// append the credentials to the return url
$url['fragment'] .= "?saml=$cred";
header('Location: ' . http_build_url($url), true, 303);

This works perfectly on chrome, but when I debug on firefox it says that $stateParams.saml is undefined, leading to an infinite loop.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.342943 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO