OpenAthens LA support ended on 31 March 2020


Skip to end of metadata
Go to start of metadata

Once configured, a datastore is available for categorising users and providing user-specific attributes.


  • Access to the administration console
  • Connection details for your MS SQL server
  • The username field from your authentication store is available in your MS SQL 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:

NameThe unique name of this datastore. Will be used elsewhere in the administration interface.
Attributes query

Table and column names are case sensitive. See below

Server hostThe address of the server. Must be reachable by the runtime server(s) as well as the administration console
Server PortDefault is 1433.
DatabaseThe database
Admin usernameA user with sufficient access to run the query over the relevant user data. Write access is not required.
Admin password 
Test usernameUsed by the test button and to populate the available attribute names. It is not otherwise used

Attribute Query

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:

SELECT Email, Role, Course, DateofBirth 
FROM Users WHERE Username = ? OR Username = ?;

The column names are case sensitive when the runtime uses them.


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

Attribute names

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.

  • No labels