diff --git a/docs/simplesamlphp-scoping.md b/docs/simplesamlphp-scoping.md
index 4f1ff87101cfeaae67eaae3350429b6544318a2c..3124122ed0d4bb0c3ecf2d65292ba4a6b371b4f9 100644
--- a/docs/simplesamlphp-scoping.md
+++ b/docs/simplesamlphp-scoping.md
@@ -88,7 +88,7 @@ The list of authenticating authorities (the AuthenticatingAuthority element)
 can be retrieved as an array from the authentication data.
 
     # Get the authentication source.
-    $as = new SimpleSAML_Auth_Simple();
+    $as = new \SimpleSAML\Auth\Simple();
 
     # Get the AuthenticatingAuthority
     $aa = $as->getAuthData('saml:AuthenticatingAuthority');
diff --git a/docs/simplesamlphp-sp-api.md b/docs/simplesamlphp-sp-api.md
index fae5b14c82c0981bebe63c0e29035a5a1aa335bb..2de1b509a698b342312ea41386657980d6efc3f9 100644
--- a/docs/simplesamlphp-sp-api.md
+++ b/docs/simplesamlphp-sp-api.md
@@ -3,15 +3,15 @@ SimpleSAMLphp SP API reference
 
 <!-- {{TOC}} -->
 
-This document describes the SimpleSAML_Auth_Simple API.
+This document describes the \SimpleSAML\Auth\Simple API.
 This is the preferred API for integrating SimpleSAMLphp with other applications.
 
 Constructor
 -----------
 
-    new SimpleSAML_Auth_Simple(string $authSource)
+    new \SimpleSAML\Auth\Simple(string $authSource)
 
-The constructor initializes a SimpleSAML_Auth_Simple object.
+The constructor initializes a \SimpleSAML\Auth\Simple object.
 
 ### Parameters
 
@@ -20,7 +20,7 @@ This authentication source must exist in `config/authsources.php`.
 
 ### Example
 
-    $auth = new SimpleSAML_Auth_Simple('default-sp');
+    $auth = new \SimpleSAML\Auth\Simple('default-sp');
 
 
 `isAuthenticated`
diff --git a/docs/simplesamlphp-sp-migration.md b/docs/simplesamlphp-sp-migration.md
index ff6f3e1ee100970412fd24165f6144d614ea561e..ae3303cf8121dea9b631be21383994e1011bd0f8 100644
--- a/docs/simplesamlphp-sp-migration.md
+++ b/docs/simplesamlphp-sp-migration.md
@@ -132,7 +132,7 @@ This API is designed to handle the common operations.
 This is a quick overview of the API:
 
     /* Get a reference to our authentication source. */
-    $as = new SimpleSAML_Auth_Simple('default-sp');
+    $as = new \SimpleSAML\Auth\Simple('default-sp');
 
     /* Require the user to be authentcated. */
     $as->requireAuth();
@@ -159,7 +159,7 @@ Generally, if you have:
 
 you should replace it with this single line:
 
-    $as = new SimpleSAML_Auth_Simple('default-sp');
+    $as = new \SimpleSAML\Auth\Simple('default-sp');
 
 
 #### Requiring authentication
diff --git a/docs/simplesamlphp-sp.md b/docs/simplesamlphp-sp.md
index 3cc6d65cf9a299429a27a8a6d4034d86d9c777c0..c7de105c25483773a1a46734d9e4df6229d12b97 100644
--- a/docs/simplesamlphp-sp.md
+++ b/docs/simplesamlphp-sp.md
@@ -168,7 +168,7 @@ We start off with loading a file which registers the SimpleSAMLphp classes with
 
 We select our authentication source:
 
-    $as = new SimpleSAML_Auth_Simple('default-sp');
+    $as = new \SimpleSAML\Auth\Simple('default-sp');
 
 We then require authentication:
 
diff --git a/lib/SimpleSAML/Auth/Simple.php b/lib/SimpleSAML/Auth/Simple.php
index 723c8667c67bdac2412327242c4e3ea20583f83d..16e8c32e6924042132522ab5bc548adf7b25899f 100644
--- a/lib/SimpleSAML/Auth/Simple.php
+++ b/lib/SimpleSAML/Auth/Simple.php
@@ -1,12 +1,19 @@
 <?php
 
+namespace SimpleSAML\Auth;
+
+use \SimpleSAML_Auth_Source as Source;
+use \SimpleSAML_Auth_State as State;
+use \SimpleSAML\Module;
+use \SimpleSAML_Session as Session;
+use \SimpleSAML\Utils\HTTP;
 
 /**
  * Helper class for simple authentication applications.
  *
  * @package SimpleSAMLphp
  */
-class SimpleSAML_Auth_Simple
+class Simple
 {
 
     /**
@@ -33,15 +40,15 @@ class SimpleSAML_Auth_Simple
     /**
      * Retrieve the implementing authentication source.
      *
-     * @return SimpleSAML_Auth_Source The authentication source.
+     * @return \SimpleSAML_Auth_Source The authentication source.
      *
-     * @throws SimpleSAML_Error_AuthSource If the requested auth source is unknown.
+     * @throws \SimpleSAML_Error_AuthSource If the requested auth source is unknown.
      */
     public function getAuthSource()
     {
-        $as = SimpleSAML_Auth_Source::getById($this->authSource);
+        $as = Source::getById($this->authSource);
         if ($as === null) {
-            throw new SimpleSAML_Error_AuthSource($this->authSource, 'Unknown authentication source.');
+            throw new \SimpleSAML_Error_AuthSource($this->authSource, 'Unknown authentication source.');
         }
         return $as;
     }
@@ -57,7 +64,7 @@ class SimpleSAML_Auth_Simple
      */
     public function isAuthenticated()
     {
-        $session = SimpleSAML_Session::getSessionFromRequest();
+        $session = Session::getSessionFromRequest();
 
         return $session->isValid($this->authSource);
     }
@@ -79,7 +86,7 @@ class SimpleSAML_Auth_Simple
     public function requireAuth(array $params = array())
     {
 
-        $session = SimpleSAML_Session::getSessionFromRequest();
+        $session = Session::getSessionFromRequest();
 
         if ($session->isValid($this->authSource)) {
             // Already authenticated
@@ -119,12 +126,12 @@ class SimpleSAML_Auth_Simple
             if (array_key_exists('ReturnCallback', $params)) {
                 $returnTo = (array) $params['ReturnCallback'];
             } else {
-                $returnTo = \SimpleSAML\Utils\HTTP::getSelfURL();
+                $returnTo = HTTP::getSelfURL();
             }
         }
 
         if (is_string($returnTo) && $keepPost && $_SERVER['REQUEST_METHOD'] === 'POST') {
-            $returnTo = \SimpleSAML\Utils\HTTP::getPOSTRedirectURL($returnTo, $_POST);
+            $returnTo = HTTP::getPOSTRedirectURL($returnTo, $_POST);
         }
 
         if (array_key_exists('ErrorURL', $params)) {
@@ -134,13 +141,13 @@ class SimpleSAML_Auth_Simple
         }
 
 
-        if (!isset($params[SimpleSAML_Auth_State::RESTART]) && is_string($returnTo)) {
+        if (!isset($params[State::RESTART]) && is_string($returnTo)) {
             /*
              * A URL to restart the authentication, in case the user bookmarks
              * something, e.g. the discovery service page.
              */
             $restartURL = $this->getLoginURL($returnTo);
-            $params[SimpleSAML_Auth_State::RESTART] = $restartURL;
+            $params[State::RESTART] = $restartURL;
         }
 
         $as = $this->getAuthSource();
@@ -161,7 +168,7 @@ class SimpleSAML_Auth_Simple
      *  - 'ReturnStateParam': The parameter we should return the state in when redirecting.
      *  - 'ReturnStateStage': The stage the state array should be saved with.
      *
-     * @param string|array|NULL $params Either the URL the user should be redirected to after logging out, or an array
+     * @param string|array|null $params Either the URL the user should be redirected to after logging out, or an array
      * with parameters for the logout. If this parameter is null, we will return to the current page.
      */
     public function logout($params = null)
@@ -169,7 +176,7 @@ class SimpleSAML_Auth_Simple
         assert('is_array($params) || is_string($params) || is_null($params)');
 
         if ($params === null) {
-            $params = \SimpleSAML\Utils\HTTP::getSelfURL();
+            $params = HTTP::getSelfURL();
         }
 
         if (is_string($params)) {
@@ -185,7 +192,7 @@ class SimpleSAML_Auth_Simple
             assert('isset($params["ReturnStateParam"]) && isset($params["ReturnStateStage"])');
         }
 
-        $session = SimpleSAML_Session::getSessionFromRequest();
+        $session = Session::getSessionFromRequest();
         if ($session->isValid($this->authSource)) {
             $state = $session->getAuthData($this->authSource, 'LogoutState');
             if ($state !== null) {
@@ -196,7 +203,7 @@ class SimpleSAML_Auth_Simple
 
             $params['LogoutCompletedHandler'] = array(get_class(), 'logoutCompleted');
 
-            $as = SimpleSAML_Auth_Source::getById($this->authSource);
+            $as = Source::getById($this->authSource);
             if ($as !== null) {
                 $as->logout($params);
             }
@@ -225,7 +232,7 @@ class SimpleSAML_Auth_Simple
             $params = array();
             if (isset($state['ReturnStateParam']) || isset($state['ReturnStateStage'])) {
                 assert('isset($state["ReturnStateParam"]) && isset($state["ReturnStateStage"])');
-                $stateID = SimpleSAML_Auth_State::saveState($state, $state['ReturnStateStage']);
+                $stateID = State::saveState($state, $state['ReturnStateStage']);
                 $params[$state['ReturnStateParam']] = $stateID;
             }
             \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['ReturnTo'], $params);
@@ -250,7 +257,7 @@ class SimpleSAML_Auth_Simple
         }
 
         // Authenticated
-        $session = SimpleSAML_Session::getSessionFromRequest();
+        $session = Session::getSessionFromRequest();
         return $session->getAuthData($this->authSource, 'Attributes');
     }
 
@@ -270,7 +277,7 @@ class SimpleSAML_Auth_Simple
             return null;
         }
 
-        $session = SimpleSAML_Session::getSessionFromRequest();
+        $session = Session::getSessionFromRequest();
         return $session->getAuthData($this->authSource, $name);
     }
 
@@ -287,7 +294,7 @@ class SimpleSAML_Auth_Simple
             return null;
         }
 
-        $session = SimpleSAML_Session::getSessionFromRequest();
+        $session = Session::getSessionFromRequest();
         return $session->getAuthState($this->authSource);
     }
 
@@ -305,10 +312,10 @@ class SimpleSAML_Auth_Simple
         assert('is_null($returnTo) || is_string($returnTo)');
 
         if ($returnTo === null) {
-            $returnTo = \SimpleSAML\Utils\HTTP::getSelfURL();
+            $returnTo = HTTP::getSelfURL();
         }
 
-        $login = SimpleSAML\Module::getModuleURL('core/as_login.php', array(
+        $login = Module::getModuleURL('core/as_login.php', array(
             'AuthId'   => $this->authSource,
             'ReturnTo' => $returnTo,
         ));
@@ -330,10 +337,10 @@ class SimpleSAML_Auth_Simple
         assert('is_null($returnTo) || is_string($returnTo)');
 
         if ($returnTo === null) {
-            $returnTo = \SimpleSAML\Utils\HTTP::getSelfURL();
+            $returnTo = HTTP::getSelfURL();
         }
 
-        $logout = SimpleSAML\Module::getModuleURL('core/as_logout.php', array(
+        $logout = Module::getModuleURL('core/as_logout.php', array(
             'AuthId'   => $this->authSource,
             'ReturnTo' => $returnTo,
         ));
diff --git a/modules/multiauth/docs/multiauth.md b/modules/multiauth/docs/multiauth.md
index 914f8153b49d8b084868f5549bd0783b46b66a03..7b3e0f273740fe3dbe44cd07c642cee6d5a25cc0 100644
--- a/modules/multiauth/docs/multiauth.md
+++ b/modules/multiauth/docs/multiauth.md
@@ -106,7 +106,7 @@ don't have redirections during the authentication process.
 
 You can also use the multiauth:preselect parameter to the login call:
 
-    $as = new SimpleSAML_Auth_Simple('my-multiauth-authsource');
+    $as = new \SimpleSAML\Auth\Simple('my-multiauth-authsource');
     $as->login(array(
         'multiauth:preselect' => 'default-sp',
     ));
diff --git a/modules/saml/docs/sp.md b/modules/saml/docs/sp.md
index 31def6f691f750721a1b46ec9a3d18763dd20a69..f72df230ec97a590325a073e4e599cb0a29e8e06 100644
--- a/modules/saml/docs/sp.md
+++ b/modules/saml/docs/sp.md
@@ -481,7 +481,7 @@ Here we will list some examples for this authentication source.
 
 ### Requesting a specific authentication method.
 
-    $auth = new SimpleSAML_Auth_Simple('default-sp');
+    $auth = new \SimpleSAML\Auth\Simple('default-sp');
     $auth->login(array(
         'saml:AuthnContextClassRef' => 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password',
     ));
@@ -492,7 +492,7 @@ Here we will list some examples for this authentication source.
     $ce = $dom->createElementNS('http://www.example.com/XFoo', 'xfoo:test', 'Test data!');
     $ext[] = new \SAML2\XML\Chunk($ce);
 
-    $auth = new SimpleSAML_Auth_Simple('default-sp');
+    $auth = new \SimpleSAML\Auth\Simple('default-sp');
     $auth->login(array(
         'saml:Extensions' => $ext,
     ));