Skip to content

feat(custom-auth): add developer guide#13

Merged
joshLong145 merged 5 commits intomasterfrom
feature/lit-3238-js-sdk-investigate-obvious-lit-issue
Jun 1, 2024
Merged

feat(custom-auth): add developer guide#13
joshLong145 merged 5 commits intomasterfrom
feature/lit-3238-js-sdk-investigate-obvious-lit-issue

Conversation

@Ansonhkg
Copy link
Contributor

@Ansonhkg Ansonhkg commented May 23, 2024

Demo

https://lit-custom-auth-developer-guide.vercel.app/

Here's an example on how to create a steps config:

const stepsConfig = [
{
step: 1,
buttonId: "connect-lit-node-client",
buttonText: "Connect LitNodeClient",
description:
"Establishes a connection with the LitNodeClient to enable subsequent blockchain interactions.",
action: () => {
connectLitNodeClientToCayenne(1);
},
},
{
step: 2,
buttonId: "connect-contracts-sdk",
buttonText: "Connect LitContracts",
description: "Sets up the LitContracts SDK for managing smart contracts.",
action: () => {
connectLitContractsToCayenne(2);
},
},
{
step: 3,
buttonId: "mint-pkp",
buttonText: "Mint a PKP",
description: "Alice mints a PKP using the LitContracts SDK.",
action: () => {
mintPkpWithLitContracts(3);
},
},
{
step: 4,
buttonId: "create-custom-auth-method",
buttonText: "Create a custom auth method",
description:
"Defines a custom authentication method, integrating it with custom validation logic in the Lit Action.",
action: () => {
createCustomAuthMethod(4);
},
},
{
step: 5,
buttonId: "add-permitted-auth-method-to-pkp",
buttonText: "Add Permitted Auth Method",
description:
"Associates the custom auth method with Alice's PKP, enabling verification of permissions via Lit Action.",
action: () => {
addPermittedAuthMethodToPkp(5);
},
},
{
step: 6,
buttonId: "create-lit-action-code",
buttonText: "Create a Lit Action code",
description:
"Creates the custom Lit Action code that will be used to handle custom validation logic.",
action: () => {
createLitActionCode(6);
},
},
{
step: 7,
buttonId: "convert-lit-action-code-to-ipfs-cid",
buttonText: "Convert Lit Action to IPFS CID",
description:
"Converts the Lit Action code into an IPFS CID, preparing it for smart contract interactions.",
action: () => {
convertLitActionCodeToIpfsCid(7);
},
},
{
step: 8,
buttonId: "permit-lit-action-to-use-pkp",
buttonText: "Permit Lit Action",
description:
"Authorizes the Lit Action code to use the PKP for signing operations.",
action: () => {
permitLitActionToUsePkp(8);
},
},
{
step: 9,
buttonId: "get-session-sigs-using-pkp-pub-key-and-custom-auth",
buttonText: "Get Session Sigs",
description:
"Retrieves session signatures using the PKP's public key combined with the custom auth method, which will be validated by the custom Lit Action code that handles the validation logic.",
action: () => {
getSessionSigsUsingPkpPubKeyAndCustomAuth(9);
},
},
{
step: 10,
buttonId: "pkp-sign-with-lit-action-session-sigs",
buttonText: "PKP Sign",
description:
"Utilizes the session signatures to sign with the PKP, demonstrating the successful execution of the custom Lit Action code, which validates the permissions and authorizes the signing operation.",
action: () => {
pkpSignWithLitActionSessionSigs(10);
},
},
];

What

A step by step interactive guide on how to use custom auth to generate session sigs

image

Copy link

@Aaryan-R-S Aaryan-R-S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks @Ansonhkg for helping out Lit community with such amazing tools 🙌🏽

@joshLong145 joshLong145 merged commit 8eba640 into master Jun 1, 2024
@joshLong145 joshLong145 deleted the feature/lit-3238-js-sdk-investigate-obvious-lit-issue branch June 1, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants