This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
forked from hvirring/simplesamlphp-sqlauthbcrypt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sql.txt
executable file
·47 lines (31 loc) · 2.02 KB
/
sql.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
sqlauthPHPPassword:SQL
=================
This is an authentication module for [SimpleSAMLphp](http://simplesamlphp.org) to authenticate a user against a SQL database table.
It uses PHP's built-in password_verify functions to securelly store password.
The implementation is based heavily on SimpleSAMLphp modules [sqlauth:SQL](http://simplesamlphp.org/docs/1.7/sqlauth:sql) and [sqlauthBcrypt:SQL](https://github.com/hvirring/simplesamlphp-sqlauthbcrypt).
Options
-------
`dsn`
: The DSN which should be used to connect to the database server. Check the various database drivers in the [PHP documentation](http://php.net/manual/en/pdo.drivers.php) for a description of the various DSN formats.
`username`
: The username which should be used when connecting to the database server.
`password`
: The password which should be used when connecting to the database server. If you are running this locally for development and you are using an empty password, set this to the empty string ('').
`query`
: The SQL query which should be used to retrieve the user. The parameters :username and :password are available. If the username/password is incorrect, the query should return no rows. The name of the columns in resultset will be used as attribute names. If the query returns multiple rows, they will be merged into the attributes. Duplicate values and NULL values will be removed.
`pepper`
: The pepper string appended to passwords before generating the hash. If you are not using a pepper, set this to the empty string ('').
`hash_column`
: The column storing password hashes.
Examples
--------
Example - MySQL server:
'phppassword-example' => array(
'sqlauthphppassword:SQL',
'dsn' => 'mysql:host=<hostname>;dbname=<database name>',
'username' => '<database user>',
'password' => '<database user password>',
'hash_column' => 'password_hash',
'query' => 'SELECT username AS uid, name AS cn, email AS mail, password_hash FROM users WHERE username = :username',
'pepper' => '<random string>',
),