User Login Flow
User Login Flow
The following diagram illustrates the user login flow in our application:
The user login process involves the following steps:
- The User enters the passphrase in the extension and sends message to background service to initiate authentication.
- The Background Service initiates the WASM module.
- The WASM Service returns after initialization.
- The Background Service sends the passphrase and encrypted keys to the WASM Service(stored in local storage).
- The WASM Service decrypts the key pairs.
- The WASM Service saves the decrypted keys in the global context(in memory).
- The WASM Service returns success if the decryption is successful.
- The Background Service requests a challenge for the public key from the Server.
- The Server returns the challenge.
- The Background Service requests the WASM Service to sign the challenge.
- The WASM Service signs the challenge using the decrypted private key.
- The WASM Service returns the signed challenge to the Background Service.
- The Background Service sends the signed challenge and public key to the Server.
- The Server verifies the signature.
- The Server returns a JWT token to the Background Service.
- The Background Service informs the User of successful login and stores the JWT token.
For more details on each step, refer to the sequence diagram above.