Once configured, a datastore is available for categorising users and providing user-specific attributes.
- Access to the administration console
- Connection details for your MySQL server
- The username field from your authentication store is available as a foreign key in your MySQL database
- A test username that has values against all the fields you will be using
Setting up using the Administration Console
On the datastores tab of the administration console, click on the plus icon in the left hand frame and select SQL databases > MySQL database. Complete the fields:
|Name||The unique name of this datastore. Will be used elsewhere in the administration interface.|
Table and column names are case sensitive. See below
|Server host||The address of the server. Must be reachable by the runtime server(s) as well as the administration console|
|Server Port||Default is 3306.|
|Admin username||A user with sufficient access to run the query over the relevant user data. Write access is not required.|
|Test username||Used by the test button and to populate the available attribute names. It is not otherwise used|
This should contain a SQL query, which returns one or more attributes. Each column returned by this query will be treated as an attribute, and each row, an attribute value. Use a question mark to represent the username passed by the authentication process, e.g:
The column names are case sensitive when the runtime uses them. Because Linux.
The test connection button checks that a connection can be made to the database server you have specified. It only checks the connection from the administration console and does not perform a query.
The test attribute query button connects using the specified admin credentials runs the query for the test username.
Now is a good time to check that the cases of the terms in the query match the cases of the fields returned and update your query if necessary.
These tests only check the connection between the administration console and the data store. The runtime must also be able to connect and this can be confirmed by setting up an attribute to be released and checking the debug page. See - How to check a datastore with the debug page
The Attribute Names tab will show a list of available attributes. Attributes can be de-selected to be made unavailable for use. The list is derived from the test username so will only cover attributes that username has.