Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Use base-url to set rpx token_url.

This fixes a problem we previously had with authentication-method=rpx
and authentication-required=read.  Now base-url must be set in config
if you plan to use RPX authentication.
  • Loading branch information...
commit 1bc924206983aab65960dc465bb1c7a3bd78eb10 1 parent 8e5bedf
@jgm authored
Showing with 9 additions and 15 deletions.
  1. +4 −8 Network/Gitit/Authentication.hs
  2. +5 −7 data/default.conf
12 Network/Gitit/Authentication.hs
@@ -52,7 +52,6 @@ import Codec.Binary.UTF8.String (encodeString)
import Data.ByteString.UTF8 (toString)
import Network.Gitit.Rpxnow as R
import Control.Monad.Reader (runReaderT, ask)
-import qualified Network.URI as U
data ValidationType = Register
| ResetPassword
@@ -439,21 +438,18 @@ loginRPXUser :: RPars -- ^ The parameters passed by the RPX callback call (afte
-> Handler
loginRPXUser params = do
cfg <- getConfig
- refer <- liftM U.parseURI getReferer
- liftIO $ logM "gitit.loginRPXUser" DEBUG $ "Referer:" ++ show refer ++ " params: " ++ show params
+ ref <- getReferer
let mtoken = rToken params
if isNothing mtoken
then do
- uri' <- liftM rqUri askRq
- let ref = fromMaybe (fromMaybe U.nullURI $ U.parseURI uri') refer
- let url = ref {U.uriPath="/_login",U.uriQuery="?destination=" ++
- (fromMaybe (U.uriPath ref) $ rDestination params)}
+ let url = baseUrl cfg ++ "/_login?destination=" ++
+ (fromMaybe ref $ rDestination params)
if null (rpxDomain cfg)
then error "rpx-domain is not set."
else do
let rpx = "https://" ++ rpxDomain cfg ++
"" ++
- urlEncode (show url)
+ urlEncode url
see rpx
else do -- We got an answer from RPX, this might also return an exception.
uid' :: Either String R.Identifier <- liftIO $
12 data/default.conf
@@ -32,8 +32,8 @@ authentication-method: form
# sets REMOTE_USER to the name of the authenticated user
# (e.g. mod_auth_cas on apache). 'rpx' means that gitit
# will attempt to log in through
-# This requires that 'rpx-domain' and 'rpx-key' be set below,
-# and that 'curl' be in the system path.
+# This requires that 'rpx-domain', 'rpx-key', and 'base-url'
+# be set below, and that 'curl' be in the system path.
user-file: gitit-users
# specifies the path of the file containing user login information.
@@ -224,11 +224,9 @@ use-feed: no
# individual pages)
-# the base URL of the wiki, to be used in constructing feed IDs.
-# If this field is left blank, gitit will get the base URL from the
-# request header 'Host'. For most users, this should be fine, but
-# if you are proxying a gitit instance to a subdirectory URL, you will
-# want to set this manually.
+# the base URL of the wiki, to be used in constructing feed IDs
+# and RPX token_urls. Set this if use-feed is 'yes' or
+# authentication-method is 'rpx'.
feed-days: 14
# number of days to be included in feeds.

0 comments on commit 1bc9242

Please sign in to comment.
Something went wrong with that request. Please try again.