Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions custom-auth/browser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
.cache
dist
node_modules
.vercel
19 changes: 19 additions & 0 deletions custom-auth/browser/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "custom-auth",
"version": "6.0.0",
"description": "Example of using custom authentication, auths that Lit doesn't support",
"main": "index.js",
"source": "src/index.ts",
"license": "MIT",
"scripts": {
"start": "parcel src/index.html",
"pub": "cd dist && vercel --prod"
},
"devDependencies": {
"parcel-bundler": "^1.12.5"
},
"dependencies": {
"@lit-protocol/lit-node-client": "^6.0.0-beta.testing3",
"ipfs-helpers": "^0.0.5"
}
}
111 changes: 111 additions & 0 deletions custom-auth/browser/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lit Protocol Custom Auth Guide</title>
<style>
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
th,
td {
border: 1px solid #ddd;
padding: 8px;
text-overflow: ellipsis;
overflow: hidden;
word-wrap: break-word;
}
th {
background-color: #f2f2f2;
text-align: left;
}
th:nth-child(1),
td:nth-child(1) {
width: 2%;
}
th:nth-child(2),
td:nth-child(2) {
width: 15%;
}
th:nth-child(3),
td:nth-child(3) {
width: 30%;
}
th:nth-child(4),
td:nth-child(4) {
width: 20%;
}
th:nth-child(5),
td:nth-child(5) {
width: 30%;
}

@media (max-width: 600px) {
th,
td {
display: block;
width: 100%;
box-sizing: border-box;
}
th {
text-align: center;
}
tr {
margin-bottom: 10px;
border: 3px solid grey;
}
th:nth-child(1),
td:nth-child(1),
th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5) {
width: 100%;
}
}
</style>
</head>
<body>
<h1>This is a simple guide for Lit Protocol custom auth</h1>
<p>
This guide outlines the process of implementing custom authentication
using Lit Protocol, starting with minting programmable key pairs (PKP) and
managing custom authentication methods. It includes steps to create and
authorize custom auth methods, convert Lit Action codes to IPFS CIDs for
smart contract interactions, and utilize session signatures to pkpSign and
executeJs, methods provided in the litNodeClient.
</p>
<table>
<thead>
<tr>
<th>Step</th>
<th>Execution</th>
<th>Description</th>
<th>Input</th>
<th>Output</th>
</tr>
</thead>
<tbody>
<!-- auto filled -->
</tbody>
</table>

<script src="./index.ts"></script>

<link
rel="stylesheet"
href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css"
/>
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script>

<!-- and it's easy to individually load additional languages -->
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/go.min.js"></script>
</body>
</html>
Loading