Steps to Secure Transaction using Transaction Security in Salesforce
Hi All!
Here we will learn how to provide security in Salesforce when you perform any event of transaction like data export or import and login to your org. Yes, Transaction Security having all features to handle a real-time event. It takes action by specifying its rules, policies and terms and condition. That means it works with three words, i.e. Action, Events, and Notification.
Action: This action is taken according to your requirements when the defined criteria are satisfied. The actions are like Two-factor authentication, Stop the Operation.
Events: Events are performed by user-specified like Export Data of selected objects, Login Ip and provide entity Authentication, Access Data for reports and connected app.
Notification: After the events and actions performed after the criteria satisfy the terms and conditions. Now we need to send the notification to the end-user by Email and using Salesforce 1.
Steps to create Transaction Security.
Step1: From Setup go to Security Controls and then select Transaction Security.
Step2: For enabling select the checkbox and then click new.
Step3: Last step fill the information and then Save.
Result:
global class RestrictLoginSafariPolicy implements TxnSecurity.PolicyCondition { public boolean evaluate(TxnSecurity.Event e) { LoginHistory Obj = [SELECT ApiType FROM LoginHistory WHERE Id = :e.data.get('LoginHistoryId')]; if(Obj.ApiType == 'Safari') { return true; } return false; } }
You have selected Generate Apex option, so Apex class is generated, so now you are not able to login from this browser.
Hope this will help you.
Thanks