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.


Adding data stores

  1. Navigate to your Access Gateway Instance.
  2. Select the Settings tab.
  3. Select the Data Stores pane.
  4. 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.

  1. Enter the following details:
    NameName used to identify the data store.My SQL Datastore

    Driver for datastore. Select any one of:

    • MySQL/MariaDB
    • PostgreSQL
    • MSSQL Server
    • OracleDB
    HostName:PortEnter the FQDN and port for the database
    DatabaseName of the database (schema) within the database.userDatabase


    Username to access the database.



    Password associated with Username.


    Advanced Query Mode

    Disabled: Specify the table name.


  2. Click the Not Validated ()button when complete. Okta Access Gateway validates the connection.
    If the validation is successful, the button changes to Valid ().
  3. In the Clause Conditions section, add a Where clause. The Where clause defines the join between the your Okta tenant and the database.
    1. Click (+) .
    2. In the new clause content dialog box, enter:


      FieldThe database field to join with


      ValueThe IDP field to join against


      The result should resemble:

      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.

    3. Click Save ()when complete.
      Repeat as required.
    4. Click Okay to save the data store definition.

    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 as don't send.
    See Manage application attributes for more information.

  4. 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.


To test a database data store:

  1. In the row associated with the database data store, click Simulate.
  2. For each where clause field, enter a value that matches the associated entry in the IDP.
  3. Click Test to run the sum the simulation.
    Click Close to end.
  4. Examine the result which should return data from the data store for the provided key.