https://github.com/thebojda/php-metamask-login
PHP example for authenticating users via the MetaMask mobile app
https://github.com/thebojda/php-metamask-login
Last synced: 8 months ago
JSON representation
PHP example for authenticating users via the MetaMask mobile app
- Host: GitHub
- URL: https://github.com/thebojda/php-metamask-login
- Owner: TheBojda
- License: mit
- Created: 2025-06-01T06:58:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-01T10:44:04.000Z (about 1 year ago)
- Last Synced: 2025-06-01T19:13:39.431Z (about 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP MetaMask Login Demo
## Usage
To use this system, you need a runtime environment accessible via **HTTPS** (such as **nginx**, **Apache**, etc.), since MetaMask only supports secure (HTTPS) links.
## Setup
1. Create a `.env` file.
2. Set the `SITE_HOST` variable to the domain where the scripts will run.
3. Set the web root directory to the `public` folder.
## Login Flow
- Open `index.php`, which displays a QR code.
- Scan the QR code with your phone.
- The **deeplink** will open **MetaMask** and load the `login.php` page with the generated `sessionid`.
## Authentication
- After a successful signature, `login.php` will store the Ethereum address in the database.
- `index.php` refreshes itself every 10 seconds to check whether the Ethereum address has been recorded for the current `sessionid`.
- If the address is found, the login is considered successful.