You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1293,8 +1292,8 @@ export class LitNodeClientNodeJs
1293
1292
// -- optional params
1294
1293
...(params.authMethods&&
1295
1294
params.authMethods.length>0&&{
1296
-
authMethods: params.authMethods,
1297
-
}),
1295
+
authMethods: params.authMethods,
1296
+
}),
1298
1297
};
1299
1298
1300
1299
logWithRequestId(requestId,'reqBody:',reqBody);
@@ -2066,25 +2065,18 @@ export class LitNodeClientNodeJs
2066
2065
};
2067
2066
2068
2067
/**
2069
-
*
2070
-
* Retrieves or generates sessionSigs (think access token) for accessing Lit Network resources.
2068
+
* Get session signatures for a set of [Lit resources](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.ILitResource.html#resource).
2071
2069
*
2072
2070
* How this function works on a high level:
2073
2071
* 1. Generate or retrieve [session keys](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.SessionKeyPair.html) (a public and private key pair)
2074
2072
* 2. Generate or retrieve the [`AuthSig`](https://v6-api-doc-lit-js-sdk.vercel.app/interfaces/types_src.AuthSig.html) that specifies the session [abilities](https://v6-api-doc-lit-js-sdk.vercel.app/enums/auth_helpers_src.LitAbility.html)
2075
2073
* 3. Sign the specific resources with the session key
2076
2074
*
2077
-
* The process follows these steps:
2078
-
* 1. Retrieves or generates a session key pair (Ed25519) for the user's device. The session key is either fetched from local storage or newly created if not found. The key does not expire.
2079
-
* 2. Generates an authentication signature (`authSig`) by signing an ERC-5573 “Sign-in with Ethereum” message, which includes resource ability requests, capabilities, expiration, the user's device session public key, and a nonce. The `authSig` is retrieved from local storage, and if it has expired, the user will be prompted to re-sign.
2080
-
* 3. Uses the session private key to sign the session public key along with the resource ability requests, capabilities, issuedAt, and expiration details. This creates a device-generated signature.
2081
-
* 4. Constructs the session signatures (`sessionSigs`) by including the device-generated signature and the original message. The `sessionSigs` provide access to Lit Network features such as `executeJs` and `pkpSign`.
2082
-
*
2083
-
* See Sequence Diagram: https://www.plantuml.com/plantuml/uml/VPH1RnCn48Nl_XLFlT1Av00eGkm15QKLWY8K9K9SO-rEar4sjcLFalBl6NjJAuaMRl5utfjlPjQvJsAZx7UziQtuY5-9eWaQufQ3TOAR77cJy407Rka6zlNdHTRouUbIzSEtjiTIBUswg5v_NwMnuAVlA9KKFPN3I0x9qSSj7bqNF3iPykl9c4o9oUSJMuElv2XQ8IHAYRt3bluWM8wuVUpUJwVlFjsP8JUh5B_1DyV2AYdD6DjhLsTQTaYd3W3ad28SGWqM997fG5ZrB9DJqOaALuRwH1TMpik8tIYze-E8OrPKU5I6cMqtem2kCqOhr4vdaRAvtSjcoMkTo68scKu_Vi1EPMfrP_xVtj7sFMaHNg-6GVqk0MW0z18uKdVULTvDWtdqko28b7KktvUB2hKOBd1asU2QgDfTzrj7T4bLPdv6TR0zLwPQKkkZpIRTY4CTMbrBpg_VKuXyi49beUAHqIlirOUrL2zq9JPPdpRR5OMLVQGoGlLcjyRyQNv6MHz4W_fG42W--xWhUfNyOxiLL1USS6lRLeyAkYLNjrkVJuClm_qp5I8Lq0krUw7lwIt2DgY9oiozrjA_Yhy0
2084
2075
*
2085
2076
* Note: When generating session signatures for different PKPs or auth methods,
2086
2077
* be sure to call disconnectWeb3 to clear auth signatures stored in local storage
2087
2078
*
2079
+
*
2088
2080
* @param { GetSessionSigsProps } params
2089
2081
*
2090
2082
* An example of how this function is used can be found in the Lit developer-guides-code repository [here](https://github.com/LIT-Protocol/developer-guides-code/tree/master/session-signatures/getSessionSigs).
@@ -2093,18 +2085,21 @@ export class LitNodeClientNodeJs
2093
2085
getSessionSigs=async(
2094
2086
params: GetSessionSigsProps
2095
2087
): Promise<SessionSigsMap>=>{
2088
+
2096
2089
// -- prepare
2097
2090
// Try to get it from local storage, if not generates one~
0 commit comments