Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Cannot login via SAML when using New UI OpenURL Services page

    • Product: Primo
    • Product Version: Primo August 2016
    • Relevant for Installation Type: Dedicated-Direct, Direct, Local, Total Care

    Symptoms

    1. The View ID contains a character that might be encoded (e.g. an underscore: 01MY_INST)
    2. OpenURLs are directed to the New UI
    3. Using the New Primo User Authentication mechanism
    4. Authentication is setup for Dual Login
    5. The Main Profile uses SAML
    6. Trying to login after following an OpenURL results in an error page
    7. The FE library server log contains an error:
      1. Indicating the View ID cannot be found
      2. The View ID contains a percent-encoded character
    2016-10-06 19:00:23,269 WARN  [t-http-bio-1701-exec-11098] [c-PrimoViewConfigurationManager] [O -] - Failed to find primo view with id 01MY%5FINST switching to default.
    

    Defect Status

    Development

    Workaround

    1. Add the code below to the custom.js file in a View customization package
      1. Add the code after the line containing:

        var app = angular.module('viewCustom', ['angularLoad']);
      2. Add the code before the line containing:

        })();
      3. In line 3 replace 5F (underscore) with the percent code for the problem character in the View ID

    2. Create the package

    3. Upload the package to the View

    function fix32700() {
        app.controller('prmAuthenticationAfterController', [function () {
            var vm = this;
            var loginServ = vm.parentCtrl.loginService;
    
            vm.$onInit = function () {
                loginServ.normalizeTargetUrl = function () {
                    let returnURL = decodeURIComponent(this.$location.absUrl());
    
                    angular.forEach(this.$state.params, function (value, key) {
                        if (key !== 'vid' && value) {
                            if (Array.isArray(value)) {
                                value.map((pValue) => {
                                    returnURL = returnURL.replace(pValue, encodeURIComponent(this.replaceCharacters(encodeURIComponent(pValue))));
                                });
                            } else {
                                let pValue = value;
                                returnURL = returnURL.replace(key+'='+pValue, key+"="+encodeURIComponent(this.replaceCharacters(encodeURIComponent(pValue))));
                            }
                        }
                    }, this);
                    return returnURL;
                }
            };
        }]);
    
        app.component('prmAuthenticationAfter', {
            bindings: {
                parentCtrl: '<'
            },
            controller: 'prmAuthenticationAfterController'
        });
    }
    fix32700();
    

     

     


    • Article last edited: 24-Mar-2017
    • Was this article helpful?