You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'<p class="description">'.__('SSO endpoint info of the IdP. URL target of the IdP where the SP will send the Authentication Request. ("SAML 2.0 Endpoint (HTTP)")', 'onelogin-saml-sso').'</p>';
'<p class="description">'.__('SLO endpoint info of the IdP. URL target of the IdP where the SP will send the SLO Request. ("SLO Endpoint (HTTP)")', 'onelogin-saml-sso').'</p>';
'<p class="description">'.__("The attribute that contains the role of the user, For example 'memberOf'. If WordPress can't figure what role assign to the user, it will assign the default role defined at the general settings.", 'onelogin-saml-sso').'</p>';
<p class="description">'.__("Sometimes role values are provided in an unique attribute statement (instead multiple attribute statements). If that is the case, activate this and the plugin will try to split those values by ;<br>Use a regular expression pattern in order to extract complex data.", 'onelogin-saml-sso').'</p>';
<p class="description">'.__("Regular expression that extract roles from complex multivalued data (required to active the previous option).<br> E.g. If the SAMLResponse has a role attribute like: CN=admin;CN=superuser;CN=europe-admin; , use the regular expression <code>/CN=([A-Z0-9\s _-]*);/i</code> to retrieve the values. Or use <code>/CN=([^,;]*)/</code>", 'onelogin-saml-sso').'</p>';
316
316
}
317
317
@@ -352,19 +352,19 @@ function plugin_setting_boolean_onelogin_saml_customize_stay_in_wordpress_after_
<p class="description">'.__("Override the lost password link. (Prevent reset password must be deactivated or the SAML SSO will be used.)", 'onelogin-saml-sso').'</p>';
echo'<p class="description">'.__('Public x509 certificate of the SP. Leave this field empty if you are providing the cert by the sp.crt.', 'onelogin-saml-sso');
echo'<p class="description">'.__('Private Key of the SP. Leave this field empty if you are providing the private key by the sp.key.', 'onelogin-saml-sso');
echo__("The username provided by the IdP"). ' "'. $username. '" '. __("is not valid and can't create the user at wordpress");
259
+
echo__("The username provided by the IdP"). ' "'. esc_attr($username). '" '. __("is not valid and can't create the user at wordpress");
258
260
exit();
259
261
}
260
262
$userdata['user_pass'] = wp_generate_password();
261
263
$user_id = wp_insert_user($userdata);
262
264
} else {
263
-
echo__("User provided by the IdP "). ' "'. $matcherValue. '" '. __("does not exist in wordpress and auto-provisioning is disabled.");
265
+
echo__("User provided by the IdP "). ' "'. esc_attr($matcherValue). '" '. __("does not exist in wordpress and auto-provisioning is disabled.");
264
266
exit();
265
267
}
266
268
267
269
if (is_a($user_id, 'WP_Error')) {
268
-
$error = $user_id->get_error_messages();
269
-
echoimplode('<br>', $error);
270
+
$errors = $user_id->get_error_messages();
271
+
foreach($errorsas$error) {
272
+
echoesc_html($error).'<br>';
273
+
}
270
274
exit();
271
275
} elseif ($user_id) {
272
276
wp_set_current_user($user_id);
@@ -324,7 +328,9 @@ function saml_sls() {
324
328
exit();
325
329
} else {
326
330
echo__("SLS endpoint found an error.");
327
-
echoimplode("<br>", $errors);
331
+
foreach($errorsas$error) {
332
+
echoesc_html($error).'<br>';
333
+
}
328
334
exit();
329
335
}
330
336
}
@@ -337,7 +343,7 @@ function saml_metadata() {
337
343
$metadata = $samlSettings->getSPMetadata();
338
344
339
345
header('Content-Type: text/xml');
340
-
echo$metadata;
346
+
echoent2ncr($metadata);
341
347
exit();
342
348
}
343
349
@@ -358,7 +364,7 @@ function initialize_saml() {
358
364
$auth = newOnelogin_Saml2_Auth($settings);
359
365
} catch (Exception$e) {
360
366
echo'<br>'.__("The Onelogin SSO/SAML plugin is not correctly configured.", 'onelogin-saml-sso').'<br>';
361
-
print_r($e->getMessage());
367
+
echoesc_html($e->getMessage());
362
368
echo'<br>'.__("If you are the administrator", 'onelogin-saml-sso').', <a href="'.get_site_url().'/wp-login.php?normal">'.__("access using your wordpress credentials", 'onelogin-saml-sso').'</a> '.__("and fix the problem", 'onelogin-saml-sso');
echo'<br>'.__("There is a private key stored at the filesystem. Protect the 'certs' path. Nobody should be allowed to access:", 'onelogin-saml-sso').'<br>'.$privatekey_url.'<br>';
59
59
}
60
60
@@ -103,14 +103,14 @@
103
103
}
104
104
if ($account_matcher == 'email' && $field == 'onelogin_saml_attr_mapping_mail') {
105
105
echo'<br>'.__("E-mail mapping is required in order to enable the SAML Single Sign On", 'onelogin-saml-sso').'<br>';
106
-
}
106
+
}
107
107
$lacked_attr_mappings[] = $name;
108
108
}
109
109
}
110
110
111
111
if (!empty($lacked_attr_mappings)) {
112
112
echo'<br>'.__("Notice that there are attributes without mapping:", 'onelogin-saml-sso').'<br>';
0 commit comments