Add Database data stores
Database based data stores can be used to augment application attribute data by accessing external database based data.
During this task we will add a database based data store.
Steps
Adding data stores
- Navigate to your Access Gateway Instance.
- Select the Settings tab.
- Select the Data Stores pane.
- Select (+)> Sql Database or (+) > LDAP Database.
Configuring an SQL Database data store
After you select SQL Database, the Create New DataStore wizard opens, initialized for SQL data stores.
- Enter the following details:
Field Description Example Name Name used to identify the data store. My SQL Datastore Driver Driver for datastore. Select any one of:
- MySQL/MariaDB
- PostgreSQL
- MSSQL Server
- OracleDB
MySQL/MariaDB HostName:Port Enter the FQDN and port for the database instance. mysqlserver.example.com:3306 Database Name of the database (schema) within the database. userDatabase Username
Username to access the database.
dbuser
Password
Password associated with Username.
password*
Advanced Query Mode
Disabled: Specify the table name.
people
-
Click the Not Validated (
)button when complete. Okta Access Gateway validates the connection.
If the validation is successful, the button changes to Valid ().
- In the Clause Conditions section, add a Where clause. The Where clause defines the join between the your Okta tenant and the database.
- Click (+) .
- In the new clause content dialog box, enter:
Field Value example
Field The database field to join with email
Value The IDP field to join against ${email@idp}
The result should resemble:Note
The Value field can contain a fixed value or a reference to a field within a data store. Most common use is ${fieldInIdP@idp} where fieldInIdP represents the field used to join against the table and is from the fields available in the idP profile.
- Click Save (
)when complete.
Repeat as required. - Click Okay to save the data store definition.
Caution
Fields used in the Where clause must be defined as attributes for the application. If the field is not listed as an application attribute, a run time error will result.
Attributes used exclusively in where clauses should be marked don't send.
See Manage application attributes for more information. - Click (+) .
- Activate the data store.
When data stores are created, they are set to inactive by default. Activate the data store by changing the Active toggle from inactive to active.
Test
To test a database data store:
- In the row associated with the database data store, click Simulate.
- For each where clause field, enter a value that matches the associated entry in the IDP.
- Click Test to run the sum the simulation.
Click Close to end. - Examine the result which should return data from the data store for the provided key.