Genian NAC can use a REST API Server as a source of user and organization information, to create local user accounts.
REST API Server requests are called using the HTTP GET method, and the response data format must be in JSON Object format.
The following example describes how to synchronize user information with REST API, from the application Slack.
User information in slack can be fetched through the users.list API, from URL https://slack.com/api/users.list which supports GET and POST requests. Info on how to use can be found at https://api.slack.com/methods/users.list
Select REST API Server as the DB type and enter https://slack.com as the server address.
Since paging is not supported, no paging-related settings are entered.
/api/users.list?token=<API Token> for the user information source.
For column name, enter the path to extract values from JSON Object.
See the content below, or the previous users.list help link for more examples.
- Create a Slack app with a properly privileged Slack Workspace account. Use ** Add features and functionality > Permissions **
- Obtain an access token and give it a
user:readOAuth Scope. In our example we will use a Bot User OAuth Access Token
- Once these steps are completed, install the app to your Workspace. The app must be reinstalled after every configuration.
Create sync settings¶
- Go to Preferences In the top menu Bar
- Go to User Authentication > Data Synchronization in the left side panel.
- Select Tasks > Create and fill out the following forms.
- ID : Select a Name for the synchronization
- Update Interval : Configure when to synchronize the information.
- Policy Apply : Enable to reflect changes after synchronization.
- DB Type :
REST API Server
- Server Address : Enter the URL of the server.
- Parameter Name for Page Number : Set the page number parameter name to be sent to the server during paging processing.
- Start Number for Page Number : Set the page start number during paging processing.
- Parameter Name for Records Size Per Page : Set the page size parameter name to be sent to the server during paging processing.
- Records Size Per Page : Set number of records to fetch per page.
- Data Source Name : Set a DSN to protect against accidental data deletion during synchs.
Steps 3-6 can be left at their default values when synching from Slack
- Data Source : Enter the path to query. In our case we will add our access token to the path where the user list is stored at slack.com.
- Where Clause for User : Leave blank.
- Column Name for Username : Enter the path of the desired user value in JSON Object. In this example we will use
members.nameto use the first name of the Slack user.
- Column Name for Full Name : Enter the path of the desired user value in JSON Object. In this example we will use
members.real_nameto use the display name of the Slack user.
- Department ID column name : Enter the path of the desired user value in JSON Object. In this example we will use
members.team_idto use the team id of the Slack user.
- You may synch any variable returned with any info field that Genian NAC supports. Example: Email addresses as Usernames (may require different permissions in data source).
- You can repeat the process show under the User Info section for Department, Job Title, Node, and Device information.