0

Is it possible to show which 'group' is required for access to a web page protected with Apache Basic Auth? Ideally, the pop-up requesting username and password would pass the 'group' required as a variable to the 'AuthName' directive. Is this possible? Is there another way to show to the user what 'group' name(s) are required for access?

bgarlock
  • 129
  • 1
  • 8

1 Answers1

0

The contents of the AuthName directive get displayed in the username/password prompt and you can enter whatever you want there:

AuthType Basic
AuthName "Network Diagrams - Please contact Bob to add you to the group noc_users if you need access to this resource." 
AuthUserFile /www/passwd/users
AuthGroupFile /www/passwd/groups
Require group noc_users

When you change the access Requirements you'll also need update the Authname, but that shouldn't be a huge overhead.

But since users only need to enter a username and a password, does it really help displaying which groups are allowed access?

HBruijn
  • 77,029
  • 24
  • 135
  • 201
  • Hi, thanks for your answer. I was hoping to script this with 'sed' to remove the 'AuthName' directive so the value could contain a variable for the 'Require' directive, but I guess if there is no way to do that, we can manually update all of the folders that are protected and manually set the group name. We have a lot of folders and groups, and it would be easiest for the user to request access for the group they need access to, instead of us backtracking to find the proper group based on the URL they are visiting. – bgarlock Oct 27 '15 at 14:31