diff --git a/html/sites/all/modules/simplesamlphp_auth/simplesamlphp_auth.module b/html/sites/all/modules/simplesamlphp_auth/simplesamlphp_auth.module
index e123181..12e5c30 100644
--- a/html/sites/all/modules/simplesamlphp_auth/simplesamlphp_auth.module
+++ b/html/sites/all/modules/simplesamlphp_auth/simplesamlphp_auth.module
@@ -194,17 +194,21 @@ function simplesamlphp_auth_init() {
               $userinfo = array('roles' => $roles);
               $user = user_save($user, $userinfo); // @todo - Fjernet rolle-delen her da den gav en bra feilmelding når roller ikke finnes ;)
             }
+            
+            if (function_exists('rules_invoke_event')) {
+              rules_invoke_event('simplesamlphp_auth_register', $user); 
+            }
 
             drupal_set_message(t("Welcome. Since this is your first time logging in, we've automatically provisioned an account for you."), 'status');
 
-            }
-            else {
-              // We are not allowed to register new users on the site through simpleSAML.
-              // We let the user know about this and redirect to the user/login page.
-              $msg = t("We are sorry. While you have successfully authenticated, you are not yet entitled to access this site. Please ask the site administrator to provision access for you.");
-              drupal_set_message($msg);
-              $_simplesamlphp_auth_as->logout('/?msg=' . $msg);
-            }
+          }
+          else {
+            // We are not allowed to register new users on the site through simpleSAML.
+            // We let the user know about this and redirect to the user/login page.
+            $msg = t("We are sorry. While you have successfully authenticated, you are not yet entitled to access this site. Please ask the site administrator to provision access for you.");
+            drupal_set_message($msg);
+            $_simplesamlphp_auth_as->logout('/?msg=' . $msg);
+          }
         }
         else {
           // If successfully logged into Drupal.
@@ -225,6 +229,10 @@ function simplesamlphp_auth_init() {
             // No need to evaluate roles, populate the user object.
             $user = $ext_user;
           }
+          
+          if (function_exists('rules_invoke_event')) {
+            rules_invoke_event('simplesamlphp_auth_login', $user); 
+          }
 
           $msg = t("Welcome back.");
           drupal_set_message($msg, 'status');
