Skip to content

Implement SIWE Authentication with Unlock Protocol and OrbisDB Verification #42

@sirgawain0x

Description

@sirgawain0x

We need to implement Sign-In with Ethereum (SIWE) authentication in our application to manage user access based on their ownership of specific NFTs (Creator Pass or Free Fan Pass).

Objectives:

  1. Implement SIWE authentication flow
  2. Verify user's NFT ownership (Creator Pass or Free Fan Pass)
  3. Restrict access to upload functionality to Creator Pass holders
  4. Allow viewing and buying content for both Creator Pass and Free Fan Pass holders

Technical Requirements:

  1. SIWE Integration:

    • Implement SIWE authentication using ethers.js and siwe npm package
    • Create a sign-in page/modal for users to connect their wallet and sign the SIWE message
    • Implement session management to maintain user authentication state
  2. NFT Verification:

  3. Access Control:

    • Modify the Upload component to check for Creator Pass ownership before allowing access
    • Implement middleware or route guards to restrict access to upload functionality
    • Allow viewing and buying content for both Creator Pass and Free Fan Pass holders
  4. UI/UX Updates:

    • Create a user profile section displaying the user's connected address and pass type
    • Update navigation to show/hide options based on the user's authentication status and pass type
    • Implement a sign-out functionality
  5. Error Handling and Edge Cases:

    • Handle cases where users don't have the required NFTs
    • Implement proper error messages and redirects for unauthorized access attempts

Acceptance Criteria:

  1. Users can successfully authenticate using SIWE
  2. Creator Pass holders can access the upload functionality
  3. Both Creator Pass and Free Fan Pass holders can view, upload and buy content
  4. Users without the required NFTs are restricted from accessing certain features
  5. The UI clearly indicates the user's authentication status and pass type
  6. Users can sign out of the application

Additional Notes:

  • Consider implementing a caching mechanism to reduce frequent blockchain queries for NFT ownership verification
  • Ensure the implementation follows best practices for Web3 authentication and security
  • Update the application's documentation to reflect the new authentication flow

This also includes tying OrbisDB into the SIWE Auth flow.

Resources:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions