Erlang -- mod_auth

inets

Reference Manual

Version 7.1

- User's Guide
- Reference Manual
- Release Notes
- PDF
- Top

- Expand All
- Contract All

### Table of Contents

- inets
  - Top of manual page
  - service_names/0
  - services/0
  - services_info/0
  - start/0
  - start/1
  - start/2
  - start/3
  - stop/0
  - stop/2
- httpc
  - Top of manual page
  - cancel_request/1
  - cancel_request/2
  - cookie_header/1
  - cookie_header/2
  - cookie_header/3
  - get_options/1
  - get_options/2
  - info/0
  - info/1
  - request/1
  - request/2
  - request/4
  - request/5
  - reset_cookies/0
  - reset_cookies/1
  - set_options/1
  - set_options/2
  - store_cookies/2
  - store_cookies/3
  - stream_next/1
  - which_cookies/0
  - which_cookies/1
  - which_sessions/0
  - which_sessions/1
- httpd
  - Top of manual page
  - info/1
  - info/2
  - info/2
  - info/3
  - info/4
  - info/3
  - parse_query/1
  - reload_config/2
  - Module:do/1
  - Module:load/2
  - Module:remove/1
  - Module:store/2
- httpd_custom_api
  - Top of manual page
  - request_header/1
  - response_default_headers/0
  - response_header/1
- httpd_socket
  - Top of manual page
  - deliver/3
  - peername/2
  - resolve/0
- httpd_util
  - Top of manual page
  - convert_request_date/1
  - create_etag/1
  - day/1
  - decode_hex/1
  - flatlength/1
  - hexlist_to_integer/1
  - integer_to_hexlist/1
  - lookup/2
  - lookup/3
  - lookup_mime/2
  - lookup_mime/3
  - lookup_mime_default/2
  - lookup_mime_default/3
  - message/3
  - month/1
  - multi_lookup/2
  - reason_phrase/1
  - rfc1123_date/0
  - rfc1123_date/1
  - split/3
  - split_path/1
  - split_script_path/1
  - strip/1
  - suffix/1
- mod_alias
  - Top of manual page
  - default_index/2
  - path/3
  - real_name/3
  - real_script_name/3
- mod_auth
  - Top of manual page
  - add_group_member/3
  - add_group_member/4
  - add_group_member/5
  - add_user/2
  - add_user/5
  - add_user/6
  - delete_group/2
  - delete_group/4
  - delete_group_member/3
  - delete_group_member/4
  - delete_group_member/5
  - delete_user/2
  - delete_user/3
  - delete_user/4
  - get_user/2
  - get_user/3
  - get_user/4
  - list_group_members/2
  - list_group_members/3
  - list_group_members/4
  - list_groups/1
  - list_groups/2
  - list_groups/3
  - list_users/1
  - list_users/2
  - list_users/3
  - update_password/5
  - update_password/6
- mod_esi
  - Top of manual page
  - deliver/2
  - Module:Function/3
  - Module:Function/2
- mod_security
  - Top of manual page
  - block_user/4
  - block_user/5
  - list_auth_users/1
  - list_auth_users/2
  - list_auth_users/2
  - list_auth_users/3
  - list_blocked_users/1
  - list_blocked_users/2
  - list_blocked_users/2
  - list_blocked_users/3
  - unblock_user/2
  - unblock_user/3
  - unblock_user/3
  - unblock_user/4
  - Module:event/4
  - Module:event/5
- http_uri
  - Top of manual page
  - decode/1
  - encode/1
  - parse/1
  - parse/2
  - scheme_defaults/0

# mod_auth

### Module

mod_auth

### Module Summary

User authentication using text files, Dets, or Mnesia database.

### Description

This module provides for basic user authentication using textual files, Dets databases, or Mnesia databases.

### Exports

add_group_member(GroupName, UserName, Options) -> true | {error, Reason} |

add_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} |

add_group_member(GroupName, UserName, Address, Port, Dir) -> true | {error, Reason} |

### Types

GroupName = string()
UserName = string()
Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
AuthPassword = string()
Reason = term()

add_group_member/3, add_group_member/4, and add_group_member/5 each adds a user to a group. If the group does not exist, it is created and the user is added to the group. Upon successful operation, this function returns true. When add_group_members/3 is called, options Port and Dir are mandatory.

add_user(UserName, Options) -> true| {error, Reason} |

add_user(UserName, Password, UserData, Port, Dir) -> true | {error, Reason} |

add_user(UserName, Password, UserData, Address, Port, Dir) -> true | {error, Reason} |

### Types

UserName = string()
Options = [Option]
Option = {password,Password} | {userData,UserData} | {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Password = string()
UserData = term()
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
AuthPassword =string()
Reason = term()

add_user/2, add_user/5, and add_user/6 each adds a user to the user database. If the operation is successful, this function returns true. If an error occurs, {error,Reason} is returned. When add_user/2 is called, options Password, UserData, Port, and Dir are mandatory.

delete_group(GroupName, Options) -> true | {error,Reason} <name>delete_group(GroupName, Port, Dir) -> true | {error, Reason} |

delete_group(GroupName, Address, Port, Dir) -> true | {error, Reason} |

### Types

Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
GroupName = string()
AuthPassword = string()
Reason = term()

delete_group/2, delete_group/3, and delete_group/4 each deletes the group specified and returns true. If there is an error, {error, Reason} is returned. When delete_group/2 is called, option Port and Dir are mandatory.

delete_group_member(GroupName, UserName, Options) -> true | {error, Reason} |

delete_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} |

delete_group_member(GroupName, UserName, Address, Port, Dir) -> true | {error, Reason} |

### Types

GroupName = string()
UserName = string()
Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
AuthPassword = string()
Reason = term()

delete_group_member/3, delete_group_member/4, and delete_group_member/5 each deletes a user from a group. If the group or the user does not exist, this function returns an error, otherwise true. When delete_group_member/3 is called, the options Port and Dir are mandatory.

delete_user(UserName,Options) -> true | {error, Reason} |

delete_user(UserName, Port, Dir) -> true | {error, Reason} |

delete_user(UserName, Address, Port, Dir) -> true | {error, Reason} |

### Types

UserName = string()
Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
AuthPassword = string()
Reason = term()

delete_user/2, delete_user/3, and delete_user/4 each deletes a user from the user database. If the operation is successful, this function returns true. If an error occurs, {error,Reason} is returned. When delete_user/2 is called, options Port and Dir are mandatory.

get_user(UserName,Options) -> {ok, #httpd_user} |{error, Reason} |

get_user(UserName, Port, Dir) -> {ok, #httpd_user} | {error, Reason} |

get_user(UserName, Address, Port, Dir) -> {ok, #httpd_user} | {error, Reason} |

### Types

UserName = string()
Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
AuthPassword = string()
Reason = term()

get_user/2, get_user/3, and get_user/4 each returns an httpd_user record containing the userdata for a specific user. If the user cannot be found, {error, Reason} is returned. When get_user/2 is called, options Port and Dir are mandatory.

list_groups(Options) -> {ok, Groups} | {error, Reason} |

list_groups(Port, Dir) -> {ok, Groups} | {error, Reason} |

list_groups(Address, Port, Dir) -> {ok, Groups} | {error, Reason} |

### Types

Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Groups = list()
AuthPassword = string()
Reason = term()

list_groups/1, list_groups/2, and list_groups/3 each lists all the groups available. If there is an error, {error, Reason} is returned. When list_groups/1 is called, options Port and Dir are mandatory.

list_group_members(GroupName, Options) -> {ok, Users} | {error, Reason} |

list_group_members(GroupName, Port, Dir) -> {ok, Users} | {error, Reason} |

list_group_members(GroupName, Address, Port, Dir) -> {ok, Users} | {error, Reason} |

### Types

GroupName = string()
Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Users = list()
AuthPassword = string()
Reason = term()

list_group_members/2, list_group_members/3, and list_group_members/4 each lists the members of a specified group. If the group does not exist or there is an error, {error, Reason} is returned. When list_group_members/2 is called, options Port and Dir are mandatory.

list_users(Options) -> {ok, Users} | {error, Reason} |

list_users(Port, Dir) -> {ok, Users} | {error, Reason} | OTP R14B01

list_users(Address, Port, Dir) -> {ok, Users} | {error, Reason} |

### Types

Options = [Option]
Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}
Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
Users = list()
AuthPassword = string()
Reason = atom()

list_users/1, list_users/2, and list_users/3 each returns a list of users in the user database for a specific Port/Dir. When list_users/1 is called, options Port and Dir are mandatory.

update_password(Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason} |

update_password(Address,Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason} |

### Types

Port = integer()
Address = {A,B,C,D} | string() | undefined
Dir = string()
GroupName = string()
OldPassword = string()
NewPassword = string()
Reason = term()

update_password/5 and update_password/6 each updates AuthAccessPassword for the specified directory. If NewPassword is equal to "NoPassword", no password is required to change authorisation data. If NewPassword is equal to "DummyPassword", no changes can be done without changing the password first.

### SEE ALSO

httpd(3), mod_alias(3)