EDS - IdP select overlap

Callum Smith callum at strubi.ox.ac.uk
Wed Apr 29 11:19:00 EDT 2015


FAO: Rod Widdowson et al

I'm going to leave this here, since the shibboleth-ds on JIRA appears to have a versioning issue on its setup (its missing the idpselect_languages.js from the build by quick look), but can't login there to submit properly:

Issue with preferedIdPs not detecting overlap with userSelectedIdPs.

Suggested fix with relatively clunky javascript implementation:

    var getPreferredIdPs = function() {
        var idps = [];
        var i;
        var j;
        var insert;
        var idp;

        //
        // populate start of array with preselected IdPs
        //
        if (null != preferredIdP){
            for (i=0; i < preferredIdP.length && i < maxPreferredIdPs-1; i++){
                idps[i] = getIdPFor(preferredIdP[i]);
            }
        }
        
        //
        // And then the cookie based ones
        //
        userSelectedIdPs = retrieveUserSelectedIdPs();
        for (i=0; i < userSelectedIdPs.length && idps.length < maxPreferredIdPs; i++){
            idp = getIdPFor(userSelectedIdPs[i]);
            insert = true;
            for (j = 0; j < idps.length; j++){
                if (idps[j] === idp){
                    insert = false;
                }
            }
            if (insert){
              idps.push(idp);
            }
        }
        return idps;
    };

PS. also modified the second cycler to run from idps.length, removing the need for offset etc.

If anyone knows a better way of comparing objects within an array in javascript that could be of use here.

Regards,

Callum Smith
Instruct & Strubi Web Developer
University of Oxford
e. callum at strubi.ox.ac.uk
p. +44 (0)1865 2 87782

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20150429/f7410ce0/attachment.html>


More information about the dev mailing list