diff --git a/lib/Network/Protocol/XMPP/Client/Authentication.hs b/lib/Network/Protocol/XMPP/Client/Authentication.hs
--- a/lib/Network/Protocol/XMPP/Client/Authentication.hs
+++ b/lib/Network/Protocol/XMPP/Client/Authentication.hs
@@ -37,7 +37,7 @@
 import qualified Network.Protocol.XMPP.XML as X
 import           Network.Protocol.XMPP.JID (JID, formatJID, jidResource)
 
-data Result = Success | Failure
+data Result = Success | Failure X.Element
 	deriving (Show, Eq)
 
 data AuthException = XmppError M.Error | SaslError Text
@@ -65,7 +65,7 @@
 				Just mechanism -> authSasl ctx mechanism
 		case res of
 			Right Success -> return ()
-			Right Failure -> E.throwError M.AuthenticationFailure
+			Right (Failure e) -> E.throwError (M.AuthenticationFailure e)
 			Left (XmppError err) -> E.throwError err
 			Left (SaslError err) -> E.throwError (M.AuthenticationError err)
 	
@@ -119,7 +119,7 @@
 				SASL.NeedsMore -> saslError "Server didn't provide enough SASL data."
 		
 		-- The server has rejected this client's credentials.
-		n | n == "{urn:ietf:params:xml:ns:xmpp-sasl}failure" -> return Failure
+		n | n == "{urn:ietf:params:xml:ns:xmpp-sasl}failure" -> return (Failure e)
 		
 		_ -> saslError ("Server sent unexpected element during authentication.")
 
@@ -128,7 +128,7 @@
 	elemt <- getElement ctx
 	return $ if X.elementName elemt == "{urn:ietf:params:xml:ns:xmpp-sasl}success"
 		then Success
-		else Failure
+		else Failure elemt
 
 putElement :: M.Session -> X.Element -> SASL.Session ()
 putElement ctx elemt = liftIO $ do
diff --git a/lib/Network/Protocol/XMPP/Component.hs b/lib/Network/Protocol/XMPP/Component.hs
--- a/lib/Network/Protocol/XMPP/Component.hs
+++ b/lib/Network/Protocol/XMPP/Component.hs
@@ -74,7 +74,7 @@
 	M.putElement (X.element "handshake" [] [X.NodeContent (X.ContentText digest)])
 	result <- M.getElement
 	let nameHandshake = "{jabber:component:accept}handshake"
-	when (null (X.isNamed nameHandshake result)) (throwError M.AuthenticationFailure)
+	when (null (X.isNamed nameHandshake result)) (throwError (M.AuthenticationFailure result))
 
 buildSecret :: Text -> Text -> ByteString
 buildSecret sid password = encodeUtf8 (X.escape (Data.Text.append sid password))
diff --git a/lib/Network/Protocol/XMPP/Monad.hs b/lib/Network/Protocol/XMPP/Monad.hs
--- a/lib/Network/Protocol/XMPP/Monad.hs
+++ b/lib/Network/Protocol/XMPP/Monad.hs
@@ -57,7 +57,11 @@
 
 data Error
 	-- | The remote host refused the specified authentication credentials.
-	= AuthenticationFailure
+	--
+	-- The included XML element is the error value that the server
+	-- provided. It may contain additional information about why
+	-- authentication failed.
+	= AuthenticationFailure X.Element
 	
 	-- | There was an error while authenticating with the remote host.
 	| AuthenticationError Text
diff --git a/network-protocol-xmpp.cabal b/network-protocol-xmpp.cabal
--- a/network-protocol-xmpp.cabal
+++ b/network-protocol-xmpp.cabal
@@ -1,5 +1,5 @@
 name: network-protocol-xmpp
-version: 0.4.4
+version: 0.4.5
 license: GPL-3
 license-file: license.txt
 author: John Millikin <jmillikin@gmail.com>, Stephan Maka <stephan@spaceboyz.net>
@@ -15,13 +15,13 @@
 description:
 
 source-repository head
-  type: bazaar
-  location: https://john-millikin.com/branches/network-protocol-xmpp/0.4/
+  type: git
+  location: https://john-millikin.com/code/haskell-xmpp/
 
 source-repository this
-  type: bazaar
-  location: https://john-millikin.com/branches/network-protocol-xmpp/0.4/
-  tag: network-protocol-xmpp_0.4.4
+  type: git
+  location: https://john-millikin.com/code/haskell-xmpp/
+  tag: network-protocol-xmpp_0.4.5
 
 library
   ghc-options: -Wall -O2
