Quantcast
Channel: Webkul Blog
Viewing all articles
Browse latest Browse all 5554

How to work with Transaction Security in Salesforce

$
0
0

In this blog, we will learn about how we can work with Transaction Security. Before we start working on it, we should have knowledge about what it states in salesforce.

Transaction Security

Transaction Security in Salesforce refers to provide security while an event or a transaction, for ex- login, data export or accessing resources. It is a feature that monitors Salesforce events in real time and takes action with respect to rules i.e. policies that we create. Basically, you can divide it into three parts, i.e. Events, Notification, and Action. Let’s discuss it thoroughly.

Events: The events which are available:

  • Data Export for selected objects (Accounts, Case, Contact, Lead, and Opportunity)
  • Entity for Authentication providers and login Ip
  • Login, for limiting the session and client browser.
  • Access resources for connected app and reports and dashboards

Notification: It states that the event has occurred as well as the criteria are satisfied for the policy to be triggered. We can notify the end user through following ways:

  • Email
  • In App Notification in Salesforce 1

Action: The actions which we can take when the criteria is satisfied.

  • Block the operation
  • Two-factor authentication
  • End the current Session
  • Send notification

Prerequisites

First of all we have to enable transaction security.

Step 1: Go to Setup > Security Controls > Transaction Security.

Step 2: Enable.

Example

Let’s take an example. In this example, we will restrict login from Safari Browser.

Step 1: Go to Setup > Security Controls > Transaction Security. Click New.

Step 2: Fill the related information as mentioned in the image below and Save.

Output

As you chose Generate Apex option, you can now observe an apex class is generated as following:

global class RestrictLoginSafariPolicyCondition implements TxnSecurity.PolicyCondition {

  public boolean evaluate(TxnSecurity.Event e) {
    LoginHistory eObj = [SELECT ApiType FROM LoginHistory WHERE Id = :e.data.get('LoginHistoryId')];
    if(eObj.ApiType == 'Safari') {
      return true;
    }

    return false;
  }
}

As well as, you will be unable to login by Safari browser.

Support

That’s all for how we can work with Transaction Security, still, if you have any issue feel free to add a ticket and let us know your views to make it better https://webkul.uvdesk.com/en/customer/create-ticket/

 


Viewing all articles
Browse latest Browse all 5554

Trending Articles