diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php
index 43d3d0a82b..45228d3957 100755
--- a/pandora_console/general/login_page.php
+++ b/pandora_console/general/login_page.php
@@ -124,6 +124,9 @@ echo '
';
'', 'class="login login_password" placeholder="'.__('Password').'"', false, true);
echo '
';
echo '';
+ if ($config['auth'] == 'saml') {
+ html_print_submit_button(__("Login with SAML"), "login_button_saml", false, 'class="sub login_boton"');
+ }
html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"');
echo '
';
break;
diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php
index 237f6ba41c..466eacc4a3 100644
--- a/pandora_console/godmode/setup/setup_auth.php
+++ b/pandora_console/godmode/setup/setup_auth.php
@@ -252,8 +252,8 @@ echo '';
// Event callback for the auth select
function show_selected_rows (event) {
var auth_method = $(this).val();
-
- if (auth_method !== 'mysql') {
+
+ if ((auth_method !== 'mysql') && (auth_method !== 'saml')) {
$('tr.remote').show();
show_autocreate_options(null);
}
@@ -266,8 +266,10 @@ echo '';
if (value !== 'mysql')
$('tr.' + value).hide();
});
+
// Show the selected auth method
$('tr.' + auth_method).show();
+
}
// Event callback for the autocreate remote users radio buttons
diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php
index d32d6e1b2e..f9d9717809 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -460,4 +460,12 @@ define("OPTION_TREE_GROUP_SELECT", 6);
define("OPTION_SINGLE_SELECT_TIME", 7);
define("OPTION_CUSTOM_INPUT", 8);
define("OPTION_AGENT_AUTOCOMPLETE", 9);
+
+/* SAML attributes constants */
+define("ROLES_AND_TAGS", "urn:mace:rediris.es:entitlement:monitoring:");
+define("USER_DESC", "commonName");
+define("ID_USER_IN_PANDORA", "eduPersonTargetedId");
+define("GROUP_IN_PANDORA", "schacHomeOrganization");
+define("MAIL_IN_PANDORA", "mail");
+
?>
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 3e2c282e13..0565ac1ec6 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -282,12 +282,17 @@ if (! isset ($config['id_user'])) {
exit ("