# OneLogin

## Overview

OneLogin is a complete Identity & Access Management system.

## Authentication

* Access OneLogin as an account owner or administrator.
* Go to **Developers** > **API Credentials**.
* On the **API Access page**, click **New Credential**.
* Give your credential a name.
  ![Osnelogin-new-api-credential](https://tray.ai/documentation/images/connectors/service/onelogin/f616170c-749314db_onelogin-new-api-credential.png)
* Click **Save**.
* Copy the **client secret** and **client ID**
  ![Osnelogin-new-api-credential](https://tray.ai/documentation/images/connectors/service/onelogin/f616170c-75493ddb_onelogin-client-secret.png)
* Open the tray workflow, click on **New Authentication**
* Paste the **client secret** and **client ID**
* Click **Next** to save the authentication

## The OneLogin Trigger

The OneLogin trigger allows you to trigger a workflow when an event occurs, for example when a user role is updated.
To setup the trigger, get the **Public URL** of your Tray Workflow, which can be found by clicking on the wheel in the top-left corner of the workflow editor:
![onelogin-workflow-settings](https://tray.ai/documentation/images/connectors/service/onelogin/f616170c-93d24a5b_onelogin-workflow-settings.png)

* Copy the **Public URL**
* Access OneLogin as an account owner or administrator.
* Go to **Developers** > **Webhooks**
* Set the format type to **JSON Array**
* Set the **Listener URL** to the **Workflow Public URL**
* Click **Save**
  ![onelogin-broadcaster-settings](https://tray.ai/documentation/images/connectors/service/onelogin/f616170c-81b3f92b_onelogin-broadcaster-settings.png)

## Example

In this example we build a simple workflow to send a slack message when a user is added to a new role. Create a new workflow with the **OneLogin Trigger**, and select the **Specific event** operation, with the event type set to **USER\_ASSIGNED\_ROLE**. Add the **slack** service from the list on the left.
![onelogin-trigger-example](https://tray.ai/documentation/images/connectors/service/onelogin/f616170c-0bd7d10d_onelogin-trigger-example.png)
You can then send the username to a Slack channel by using the Slack connector and setting its Message property value to a JSONpath of the Webhook's Request Query Parameters.
![onelogin-slack-connector](https://tray.ai/documentation/images/connectors/service/onelogin/f616170c-357242e5_onelogin-slack-connector.gif)
