Local credential store

Storing Salesforce org credentials locally and using them without having to manually type in, had been a challenge for developers. Using browser extensions can lead to security compromise and thus are not allowed by organizations, using URLs with credentials as query string was the savior. However, from Spring 22 release, Salesforce has disabled this ability.

Bookmarklets:

Bookmarklets are essentially a psuedo javascript scripts which we can run on click of bookmark.

This script can autofill credentials and enact button click thus, can be used as replacements for using usernames and passwords as HTTP URL query string parameters.

Bookmarklets can be locally stored. Also these can be exported with bookmark html file.

How to create bookmarklet?

javascript pseudo selector should be used before IIFE function. IIFE is immediately invoked function expression.

Let's take a look at example:

javascript:(() => { document.getElementById("username").value="test@test.com.sandbox"; document.getElementById("password").value="MyPassword123"; document.getElementById("Login").click(); })();

Save above as bookmark

Usage and limitation:

Bookmarklets should be used to manipulate DOM. 

There are no specific restrictions around what you can and can not do.

However, bookmarklets does not work with empty tab (no url in tab)








Thanks for your time to go through the post, hope it helps!





Popular posts from this blog

Create File versions from Apex

Run as different user in Apex

Creating JKS certificate for JWT Bearer flow in Salesforce