[js-embedded-discovery] 01/01: testbed

Rod Widdowson rdw at steadingsoftware.com
Tue Jun 10 12:19:37 UTC 2025


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch dev/testbed
in repository js-embedded-discovery.

View the commit online:
http://git.shibboleth.net/view/?p=js-embedded-discovery.git;a=commit;h=d860d48e8f384b5a62283763afe8ffeb41b09b76

commit d860d48e8f384b5a62283763afe8ffeb41b09b76
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Jun 7 16:14:59 2025 +0100

    testbed
---
 src/javascript/blank.gif           | Bin 0 -> 43 bytes
 src/javascript/idpselect.css       | 213 +++++++++++++++++++++++++++++++++++++
 src/javascript/idpselect_config.js |   6 +-
 src/javascript/index.html          |  41 +++++++
 src/javascript/sample.json         | 163 ++++++++++++++++++++++++++++
 5 files changed, 420 insertions(+), 3 deletions(-)

diff --git a/src/javascript/blank.gif b/src/javascript/blank.gif
new file mode 100644
index 0000000..2799b45
Binary files /dev/null and b/src/javascript/blank.gif differ
diff --git a/src/javascript/idpselect.css b/src/javascript/idpselect.css
new file mode 100644
index 0000000..9b480b4
--- /dev/null
+++ b/src/javascript/idpselect.css
@@ -0,0 +1,213 @@
+/* Top level is idpSelectIdPSelector */
+#idpSelectIdPSelector
+{
+    width: 389px;
+    text-align: left;
+    background-color: #FFFFFF;
+    border: 2px #A40000 solid;
+    padding: 10px;
+}
+
+/* Next down are the idpSelectPreferredIdPTile, idpSelectIdPEntryTile & idpSelectIdPListTile */
+
+/** 
+ * The preferred IdP tile (if present) has a specified height, so
+ * we can fit the preselected * IdPs in there
+ */
+#idpSelectPreferredIdPTile
+{
+    height:138px; /* Force the height so that the  selector box
+                   * goes below when there is only one preslect 
+                   */
+}
+#idpSelectPreferredIdPTileNoImg
+{
+    height:60px;
+}
+
+/***
+ *  The preselect buttons
+ */
+div.IdPSelectPreferredIdPButton
+{
+    margin: 3px;
+    width: 120px;  /* Make absolute because 3 of these must fit inside 
+                      div.IdPSelect{width} with not much each side. */
+    float: left;
+}
+
+/*
+ *  Make the entire box look like a hyperlink
+ */
+div.IdPSelectPreferredIdPButton a
+{
+    float: left;
+    width: 99%; /* Need a specified width otherwise we'll fit
+                   the contents which we don't want because
+                   they have auto margins */
+    
+}
+div.IdPSelectTextDiv{
+    height: 3.5ex; /* Add some height to separate the text from the boxes */
+    font-size: 15px;
+    clear: left;
+}
+
+div.IdPSelectPreferredIdPImg
+{
+/*  max-width: 95%; */
+    height: 69px; /* We need the absolute height to force all buttons to the same size */
+    margin: 2px;
+}
+
+img.IdPSelectIdPImg {
+   width:auto;
+}
+
+div.IdPSelectautoDispatchTile {
+    display: block;
+}
+
+div.IdPSelectautoDispatchArea {
+    margin-top: 30px ;
+}
+
+div.IdPSelectPreferredIdPButton img
+{
+    display: block;    /* Block display to allow auto centring */
+    max-width:  114px; /* Specify max to allow scaling, percent does work */
+    max-height: 64px;  /* Specify max to allow scaling, percent doesn't work */
+    margin-top: 3px ;
+    margin-bottom: 3px ;
+    border: solid 0px #000000;  /* Strip any embellishments the brower may give us */
+    margin-left: auto; /* Auto centring */
+    margin-right: auto;  /* Auto centring */
+
+}
+
+div.IdPSelectPreferredIdPButton div.IdPSelectTextDiv
+{
+    text-align: center;
+    font-size: 12px;
+    font-weight: normal;
+    max-width: 95%;
+    height: 30px;       /* Specify max height to allow two lines.  The 
+                         * Javascript controlls the max length of the
+                         * strings 
+                         */
+}
+
+/*
+ * Force the size of the selectors and the buttons
+ */
+#idpSelectInput, #idpSelectSelector
+{
+    width: 80%;
+}
+/*
+ * For some reason a <select> width includes the border and an
+ * <input> doesn't hence we have to force a margin onto the <select>
+ */
+#idpSelectSelector
+{
+    margin-left: 2px;
+    margin-right: 2px;
+
+}
+#idpSelectSelectButton, #idpSelectListButton
+{
+    margin-left: 5px;
+    width: 16%;
+}
+#idpSelectSelectButton
+{
+    padding-left: 2px;
+    padding-right: 2px;
+}
+
+/*
+ * change underlining of HREFS
+ */
+#idpSelectIdPSelector a:link 
+{
+    text-decoration: none;
+}
+
+#idpSelectIdPSelector a:visited 
+{
+    text-decoration: none;
+}
+
+#idpSelectIdPSelector a:hover 
+{
+    text-decoration: underline;
+}
+
+
+
+/* 
+ * Arrange to have the dropdown/list aref on the left and the 
+ * help button on the right 
+ */
+
+a.IdPSelectDropDownToggle
+{
+    display: inline-block;
+    width: 80%;
+}
+
+a.IdPSelectHelpButton
+{
+    display: inline-block;
+    text-align: right;
+    width: 20%;
+}
+
+/**
+ * Drop down (incremental search) stuff - see the associated javascript for reference
+ */
+ul.IdPSelectDropDown {
+    -moz-box-sizing: border-box;
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: small;
+    box-sizing: border-box;
+    list-style: none;
+    padding-left: 0px;
+    border: 1px solid black;
+    z-index: 6;
+    position: absolute;   
+}
+
+ul.IdPSelectDropDown li {
+    background-color: white;
+    cursor: default;
+    padding: 0px 3px;
+}
+
+ul.IdPSelectDropDown li.IdPSelectCurrent {
+    background-color: #3366cc;
+    color: white;
+}
+
+/* Legacy */
+div.IdPSelectDropDown {
+    -moz-box-sizing: border-box;
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: small;
+    box-sizing: border-box;
+    border: 1px solid black;
+    z-index: 6;
+    position: absolute;   
+}
+
+div.IdPSelectDropDown div {
+    background-color: white;
+    cursor: default;
+    padding: 0px 3px;
+}
+
+ div.IdPSelectDropDown div.IdPSelectCurrent {
+    background-color: #3366cc;
+    color: white;
+}
+/* END */
diff --git a/src/javascript/idpselect_config.js b/src/javascript/idpselect_config.js
index 09fecfd..db5dabc 100644
--- a/src/javascript/idpselect_config.js
+++ b/src/javascript/idpselect_config.js
@@ -4,16 +4,16 @@ function IdPSelectUIParms(){
     // Adjust the following to fit into your local configuration
     //
     this.alwaysShow = true;          // If true, this will show results as soon as you start typing
-    this.dataSources = ['/Shibboleth.sso/DiscoFeed'];   // Where to get the data from (in an array)
+    this.dataSources = ['sample.json'];   // Where to get the data from (in an array)
     this.defaultLanguage = 'en';     // Language to use if the browser local doesnt have a bundle
     this.selectedLanguage = null;    // Set this to override the browser default (for instance if you can
                                      // detect this from the URL.
     this.defaultLogo = 'blank.gif';  // Replace with your own logo
     this.defaultLogoWidth = 1;
     this.defaultLogoHeight = 1 ;
-    this.defaultReturn = null;       // If non null, then the default place to send users who are not
+    //this.defaultReturn = null;       // If non null, then the default place to send users who are not
                                      // Approaching via the Discovery Protocol for example
-    //this.defaultReturn = "https://example.org/Shibboleth.sso/DS?SAMLDS=1&target=https://example.org/secure";
+    this.defaultReturn = "https://example.org/Shibboleth.sso/LoginX?SAMLDS=1&target=https://example.org/secure";
     this.defaultReturnIDParam = null;
     this.redirectAllow = [ "^https:\/\/example\.org\/Shibboleth\.sso\/Login.*$" , "^https:\/\/example\.com\/Shibboleth\.sso\/Login.*$" ];
     this.helpURL = 'https://wiki.shibboleth.net/confluence/display/SHIB2/DSRoadmap';
diff --git a/src/javascript/index.html b/src/javascript/index.html
new file mode 100644
index 0000000..50b02ad
--- /dev/null
+++ b/src/javascript/index.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+  <title>IDP select test bed</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
+  <link rel="stylesheet" type="text/css" href="idpselect.css" />
+</head>
+
+<body>
+  <div id="idpSelect"></div>
+
+  <script src="idpselect_config.js" type="text/javascript" language="javascript"></script>
+  <script src="idpselect_languages.js" type="text/javascript" language="javascript"></script>
+  <script src="typeahead.js" type="text/javascript" language="javascript"></script>
+
+
+  <script src="idpselect.js" type="text/javascript" language="javascript"></script>
+
+
+  <noscript>
+    <!-- If you need to care about non javascript browsers you will need to 
+         generate a hyperlink to a non-js DS.
+
+         To build you will need:
+             - URL:  The base URL of the DS you use
+             - EI: Your entityId, URLencoded.  You can get this from the line that 
+               this page is called with.
+             - RET: Your return address dlib-adidp.ucs.ed.ac.uk. Again you can get
+               this from the page this is called with, but beware of the 
+               target%3Dcookie%253A5269905f bit..
+
+        < href=${URL}?entityID=${EI}&return=${RET}
+     -->
+
+    Your Browser does not support javascript. Please use 
+    <a href="http://federation.org/DS/DS?entityID=https%3A%2F%2FyourentityId.edu.edu%2Fshibboleth&return=https%3A%2F%2Fyourreturn.edu%2FShibboleth.sso%2FDS%3FSAMLDS%3D1%26target%3Dhttps%3A%2F%2Fyourreturn.edu%2F">this link</a>.
+
+  </noscript>
+</body>
+</html>
diff --git a/src/javascript/sample.json b/src/javascript/sample.json
new file mode 100644
index 0000000..5886e7b
--- /dev/null
+++ b/src/javascript/sample.json
@@ -0,0 +1,163 @@
+[
+{
+ "entityID": "https://idp2.iay.org.uk/idp/shibboleth",
+ "DisplayNames": [
+  {
+  "value": "Ian A. Young",
+  "lang": "en"
+  }
+ ],
+    "Keywords": [ {"value":"wibble",   "lang": "en"}],
+    "Hints" :  "wobble wybble",
+ "Descriptions": [
+  {
+  "value": "This is the identity provider for the iay.org.uk domain.",
+  "lang": "en"
+  }
+ ],
+ "Logos": [
+  {
+  "value": "https://idp2.iay.org.uk/images/heads_80x80.jpg",
+  "height": "80",
+  "width": "80"
+  },
+  {
+  "value": "https://idp2.iay.org.uk/images/heads_100x43.jpg",
+  "height": "43",
+  "width": "100"
+  },
+  {
+  "value": "https://idp2.iay.org.uk/images/heads_240x104.jpg",
+  "height": "104",
+  "width": "240"
+  }
+ ]
+},
+{
+ "entityID": "urn:mce:c.uk:sdss.c.uk:provider:identity:dur.c.uk",
+ "DisplayNames": [
+  {
+  "value": "Universität für Durhäm",
+  "lang": "en"
+  }
+ ],
+    "Hints" : "wybble",
+    "Logos": [
+  {
+  "value": "https://shib.dur.ac.uk/idp/images/du90x101.png",
+  "height": "101",
+  "width": "90"
+  },
+  {
+  "value": "https://shib.dur.ac.uk/idp/images/du16x16.png",
+  "height": "16",
+  "width": "16"
+  }
+ ]
+},
+{
+ "entityID": "urn:mace:ac.uk:sdss.ac.uk:provider:identity:uhi.ac.uk",
+ "DisplayNames": [
+  {
+  "value": "University of the Highlands and Islands",
+  "lang": "en"
+  },
+  {
+  "value": "Oilthigh na Gàidhealtachd agus nan Eilean",
+  "lang": "gd"
+  }
+ ],
+ "Logos": [
+  {
+  "value": "https://www.uhi.ac.uk/en/t4-media/one-web/university/admin-assets/img/logos/uhi-80-60-icon.png",
+  "height": "60",
+  "width": "80"
+  },
+  {
+  "value": "https://www.uhi.ac.uk/en/t4-media/one-web/university/admin-assets/img/favicon.ico",
+  "height": "16",
+  "width": "16"
+  }
+ ]
+},
+{
+ "entityID": "https://idp.cardiff.ac.uk/shibboleth",
+ "DisplayNames": [
+  {
+  "value": "Cardiff University",
+  "lang": "en"
+  },
+  {
+  "value": "Prifysgol Caerdydd",
+  "lang": "cy"
+  }
+ ],
+ "Logos": [
+  {
+  "value": "https://static.cf.ac.uk/images/FAMLogos/cu-logo-16x16.png",
+  "height": "16",
+  "width": "16"
+  },
+  {
+  "value": "https://static.cf.ac.uk/images/FAMLogos/cu-logo-128x126.png",
+  "height": "126",
+  "width": "128"
+  },
+  {
+  "value": "https://static.cf.ac.uk/images/FAMLogos/cu-logo-64x62.png",
+  "height": "62",
+  "width": "64"
+  },
+  {
+  "value": "https://static.cf.ac.uk/images/FAMLogos/cu-logo-80x60t.png",
+  "height": "60",
+  "width": "80"
+  }
+ ]
+},
+{
+ "entityID": "urn:mace:kuleuven.be:kulassoc:kuleuven.be",
+ "DisplayNames": [
+  {
+  "value": "Associatie KU Leuven",
+  "lang": "nl"
+  },
+  {
+  "value": "KU Leuven Association",
+  "lang": "en"
+  }
+ ],
+ "Descriptions": [
+  {
+  "value": "KU Leuven en de geassocieerde hogescholen",
+  "lang": "nl"
+  },
+  {
+  "value": "KU Leuven and the associated University Colleges",
+  "lang": "en"
+  }
+ ],
+ "InformationURLs": [
+  {
+  "value": "http://associatie.kuleuven.be/over",
+  "lang": "nl"
+  },
+  {
+  "value": "http://associatie.kuleuven.be/eng",
+  "lang": "en"
+  }
+ ],
+ "Logos": [
+  {
+  "value": "https://stijl.kuleuven.be/shibboleth/images/associatie-kuleuven-favicon.png",
+  "height": "16",
+  "width": "16"
+  },
+  {
+  "value": "https://stijl.kuleuven.be/shibboleth/images/associatie-kuleuven-hosted-by.png",
+  "height": "56",
+  "width": "150"
+  }
+ ]
+}
+]

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list