-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
WebSVN currently supports authentication if HTTP Basic Auth is used.
But this usually means you would have to put the whole WebSVN directory behind a Basic Auth password protection.
In my case, I want to have all projects publish, except a few. The few private projects should be displayed when the user logs in.
I have developed the following solution which I would like to share:
File login.php
<?php
// .htaccess does the magic in re auth!
header('Location:index.php');
File .htaccess
CGIPassAuth On
<Files login.php>
AuthType basic
AuthName "private area"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Files>
order allow,deny
deny from all
satisfy any
Then you need to include a login button somewhere on the page.
Downsides of this solution:
- Because of the Basic Auth, a logout is technically not possible
- The path to .htpasswd needs to be included in the .htaccess. Therefore I guess the .htaccess can only be delivered fully commented out. People who want to enable the feature need to edit .htaccess.
- .htaccess is only possible on Apache, but the configuration "ask for auth only for file login.php" might also be possible on other HTTP daemons.
What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels