In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

This Server has been upgraded to GitLab release 14.2.6

default-embedded-wayf.php 10.6 KB
Newer Older
haemmer's avatar
haemmer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!-- EMBEDDED-WAYF-START -->
<script type="text/javascript"><!--
// To use this JavaScript, please access:
// https://<?php echo $host ?><?php echo $path ?>/embedded-wayf.js/snippet.html
// and copy/paste the resulting HTML snippet to an unprotected web page that 
// you want the embedded WAYF to be displayed


//////////////////// ESSENTIAL SETTINGS ////////////////////

// URL of the WAYF to use
// Examples: "https://wayf.switch.ch/SWITCHaai/WAYF", "https://wayf-test.switch.ch/aaitest/WAYF";
// [Mandatory]
var wayf_URL = "https://<?php echo $host ?><?php echo $path ?>";

// EntityID of the Service Provider that protects this Resource
// Examples: "https://econf.switch.ch/shibboleth", "https://dokeos.unige.ch/shibboleth"
// [Mandatory]
var wayf_sp_entityID = "https://my-app.switch.ch/shibboleth";

// Session Initiator URL of the Service Provider
// Examples: "https://econf.switch.ch/Shibboleth.sso/DS", "https://dokeos.unige.ch/Shibboleth.sso/DS"
// [Mandatory, if wayf_use_discovery_service = false]
var wayf_sp_handlerURL = "https://my-app.switch.ch/Shibboleth.sso";

// URL on this resource that the user shall be returned to after authentication
// Examples: "https://econf.switch.ch/aai/home", "https://olat.uzh.ch/my/courses"
// [Mandatory]
var wayf_return_url = "https://my-app.switch.ch/aai/index.php?page=show_welcome";


//////////////////// RECOMMENDED SETTINGS ////////////////////

// Width of the embedded WAYF in pixels or "auto"
35
36
37
// This is the width of the content only (without padding and border). 
// Add 2 x (10px + 1px) = 22px for padding and border to get the actual 
// width of everything that is drawn.
haemmer's avatar
haemmer committed
38
// [Optional, default: "auto"]
haemmer's avatar
haemmer committed
39
var wayf_width = "auto";
haemmer's avatar
haemmer committed
40
41

// Height of the embedded WAYF in pixels or "auto"
42
43
44
// This is the height of the content only (without padding and border). 
// Add 2 x (10px + 1px) = 22px for padding and border to get the actual 
// height of everything that is drawn.
haemmer's avatar
haemmer committed
45
46
47
48
49
50
51
// [Optional, default: "auto"]
var wayf_height = "auto";

// Whether to show the checkbox to remember settings for this session
// [Optional, default: true]
var wayf_show_remember_checkbox = true;

haemmer's avatar
haemmer committed
52
53
54
55
56
57
58
// Force the user's Home Organisation selection to be remembered for the
// current browser session. If wayf_show_remember_checkbox is true
// the checkbox will be shown but will be read only.
// WARNING: Only use this feature if you know exactly what you are doing
//          This option will cause problems that are difficult to find 
//          in case they accidentially select a wrong Home Organisation
// [Optional, false]
59
var wayf_force_remember_for_session = false;
haemmer's avatar
haemmer committed
60

haemmer's avatar
haemmer committed
61
// Logo size
62
// Choose whether the small or large logo shall be used
haemmer's avatar
haemmer committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// [Optional, default: true]
var wayf_use_small_logo = true;

// Font size
// [Optional, default: 12]
var wayf_font_size = 12;

// Font color
// [Optional, default: #000000]
var wayf_font_color = '#000000';

// Border color
// [Optional, default: #00247D]
var wayf_border_color = '#00247D';

// Background color
// [Optional, default: #F4F7F7]
var wayf_background_color = '#F4F7F7';

// Whether to automatically log in user if he has a session/permanent redirect
// cookie set at central wayf
// [Optional, default: true]
var wayf_auto_login = true;

// Whether to hide the WAYF after the user was logged in
// This requires that the _shib_session_* cookie is set when a user 
// could be authenticated, which is the default case when Shibboleth is used.
// For other Service Provider implementations have a look at the setting
// wayf_check_login_state_function that allows you to customize this
// [Optional, default: true]
var wayf_hide_after_login = true;

// Whether or not to show the categories in the drop-down list
// Possible values are: true or false
// [Optional, default: true]
var wayf_show_categories =  true;

100
// Most used Identity Providers will be shown as top category in the drop down
haemmer's avatar
haemmer committed
101
102
// list if this feature is used.
// [Optional, commented out by default]
103
// var wayf_most_used_idps =  new Array("https://aai-logon.unibas.ch/idp/shibboleth", "https://aai.unil.ch/idp/shibboleth");
haemmer's avatar
haemmer committed
104
105
106

// Categories of Identity Provider that shall not be shown
// Possible values are: <?php echo $types ?>, "all"
107
108
// Example of how to hide categories
// var wayf_hide_categories =  new Array("other", "library");
haemmer's avatar
haemmer committed
109
110
111
112
113
114
115
// [Optional, commented out by default]
// var wayf_hide_categories =  new Array();

// EntityIDs of Identity Provider whose category is hidden but that shall be shown anyway
// If this array is not empty, wayf_show_categories will be disabled because
// otherwise, unhidden IdPs may be displayed in the wrong category
// Example of how to unhide certain Identity Providers
116
// var wayf_unhide_idps = new Array("https://aai-login.uzh.ch/idp/shibboleth");
haemmer's avatar
haemmer committed
117
118
119
120
121
// [Optional, commented out by default]
// var wayf_unhide_idps = new Array();

// EntityIDs of Identity Provider that shall not be shown at all
// Example of how to hide certain Identity Provider
122
// var wayf_hide_idps = new Array("https://idp.unige.ch/idp/shibboleth", "https://lewotolo.switch.ch/idp/shibboleth");
haemmer's avatar
haemmer committed
123
124
125
126
127
// [Optional, commented out by default]
// var wayf_hide_idps = new Array();

//////////////////// ADVANCED SETTINGS ////////////////////

128
129
130
131
132
133
134
// Use the SAML2/Shibboleth 2 Discovery Service protocol where
// the user is sent back to the Service Provider after selection
// of his Home Organisation.
// This is true by default and it should only be uncommented and set to false
// if there is a good reason why to use the old and deprecated Shibboleth WAYF
// protocol instead.
// [Optional, default: commented out]
135
// var wayf_use_discovery_service = false;
haemmer's avatar
haemmer committed
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

// Session Initiator URL of the Service Provider
// Examples: "https://econf.switch.ch/Shibboleth.sso/DS", "https://dokeos.unige.ch/Shibboleth.sso/DS"
// This will implicitely be set to wayf_sp_samlDSURL = wayf_sp_handlerURL + "/DS";
// [Optional, if wayf_use_discovery_service = true 
//  or if wayf_additional_idps is not empty, default: commented out]
// var wayf_sp_samlDSURL = wayf_sp_handlerURL + "/Login";

// Default IdP to preselect when central WAYF couldn't guess IdP either
// This is usually the case the first time ever a user accesses a resource
// [Optional, default: commented out]
// var wayf_default_idp = "https://aai.switch.ch/idp/shibboleth";

// Set a custom Assertion Consumer URL instead of
// the default wayf_sp_handlerURL + '/SAML/POST'
// Only relevant if wayf_use_discovery_service is false
// Examples: "https://olat.uzh.ch/shib/samlaa", 
// This will implicitely be set to wayf_sp_samlACURL = wayf_sp_handlerURL + "/SAML/POST";
// "https://foodle.feide.no/simplesaml/shib13/sp/AssertionConsumerService.php"
// [Optional, commented out by default]
// var wayf_sp_samlACURL = "https://maclh.switch.ch/foo/bar";

// Overwites the text of the checkbox if
// wayf_show_remember_checkbox is set to true
// [Optional, commented out by default]
// var wayf_overwrite_checkbox_label_text = 'Save setting for today';

// Overwrites the text of the submit button
// [Optional, commented out by default]
// var wayf_overwrite_submit_button_text = 'Go';

// Overwrites the intro text above the drop-down list
// [Optional, commented out by default]
// var wayf_overwrite_intro_text = 'Select your Home Organisation to log in';

171
172
173
174
175
// Overwrites the category name of the most used IdP category in the drop-down list
// [Optional, commented out by default]
// var wayf_overwrite_most_used_idps_text = 'Most popular';


haemmer's avatar
haemmer committed
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// Whether to hide the WAYF after the user was logged in
// This requires that the _shib_session_* cookie is set when a user 
// could be authenticated
// If you want to hide the embedded WAYF completely, uncomment
// the property and set it to "". This then won't draw anything
// [Optional, default commented out: You are already logged in]
// var wayf_logged_in_messsage = "";

// Provide the name of a JavaScript function that checks whether the user
// already is logged in. The function should return true if the user is logged
// in or false otherwise. If the user is logged in, the Embedded WAYF will
// hide itself or draw a custom message depending on the 
// setting wayf_logged_in_messsage
// The function you specify has of course to be implemented by yourself!
// [Optional, commented out by default]
// var wayf_check_login_state_function = function() { 
// if (# specify user-is-logged-in condition#)
//   return true;
// else 
//   return false;
// }

// EntityIDs, Names and SSO URLs of Identity Providers from other federations 
// that shall be added to the drop-down list
// The IdPs will be displayed in the sequence they are defined
// [Optional, commented out by default]
// var wayf_additional_idps = [ ];

// Example of how to add Identity Provider from other federations
// var wayf_additional_idps = [ 
//        
//        {name:"International University X",
208
//        entityID:"urn:mace:switch.ch:SWITCHaai:example.university.org",
haemmer's avatar
haemmer committed
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
//        SAML1SSOurl:"https://int.univ.org/shibboleth-idp/SSO"},
//
//        {name:"Some Other University",
//        entityID:"https://other.univ.edu/idp/shibboleth",
//        SAML1SSOurl:"https://other.univ.edu/shibboleth-idp/SSO"},
// ];


//////////////////// ADDITIONAL CSS CUSTOMIZATIONS ////////////////////

// To further customize the appearance of the Embedded WAYF you could
// define CSS rules for the following CSS IDs that are used within the 
// Embedded WAYF:
// #wayf_div                     - Container for complete Embedded WAYF
// #wayf_logo_div                - Container for logo
// #wayf_logo                    - Image for logo
// #wayf_intro_div               - Container of drop-down list intro label
// #wayf_intro_label             - Label of intro text
// #IdPList                      - The form element
// #user_idp                     - Select element for drop-down list
// #wayf_remember_checkbox_div   - Container of checkbox and its label
// #wayf_remember_checkbox       - Checkbox for remembering settings for session
// #wayf_remember_checkbox_label - Text of checkbox
// #wayf_submit_button           - Submit button
//
// Use these CSS IDs carefully and at own risk because future updates could
// interfere with the rules you created and the IDs may change without notice!


//-->
</script>

<script type="text/javascript" src="https://<?php echo $host ?><?php echo $path ?>/embedded-wayf.js"></script>

<noscript>
  <!-- 
  Fallback to Shibboleth DS session initiator for non-JavaScript users 
  You should set the value of the target GET parameter to an URL-encoded 
  absolute URL that points to a Shibboleth protected web page where the user 
  is logged in into your application.
  -->
  <p>
    <strong>Login:</strong> Javascript is not available for your web browser. Therefore, please <a href="/Shibboleth.sso/DS?target=">proceed manually</a>.
  </p>
</noscript>

<!-- EMBEDDED-WAYF-END -->