{"id":19056380,"url":"https://github.com/lamnhan066/auth_email","last_synced_at":"2026-05-09T19:35:09.502Z","repository":{"id":57680660,"uuid":"495491653","full_name":"lamnhan066/auth_email","owner":"lamnhan066","description":"Send OTP via email with PHP backend for Flutter","archived":false,"fork":false,"pushed_at":"2025-07-19T13:20:37.000Z","size":1127,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-15T19:07:48.461Z","etag":null,"topics":["authentication","dart","flutter","php","plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lamnhan066.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-23T16:35:23.000Z","updated_at":"2025-07-19T13:20:41.000Z","dependencies_parsed_at":"2023-01-30T02:45:17.076Z","dependency_job_id":"9c70cf47-95ce-43c3-b51d-dc9fe0168558","html_url":"https://github.com/lamnhan066/auth_email","commit_stats":null,"previous_names":["lamnhan066/auth_email"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/lamnhan066/auth_email","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamnhan066%2Fauth_email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamnhan066%2Fauth_email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamnhan066%2Fauth_email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamnhan066%2Fauth_email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamnhan066","download_url":"https://codeload.github.com/lamnhan066/auth_email/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamnhan066%2Fauth_email/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32833239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","dart","flutter","php","plugin"],"created_at":"2024-11-08T23:49:14.443Z","updated_at":"2026-05-09T19:35:09.496Z","avatar_url":"https://github.com/lamnhan066.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth Email\n\nThis plugin provides a simple and secure way to authenticate user emails using OTP with a PHP backend hosted on your own server.\n\nThe OTP is encrypted using SHA256, combining the email, OTP, and a salt value. This ensures enhanced security by transmitting a hashed OTP from the server instead of the raw value.\n\n## Server Side\n\n* Download php server from [v0.0.5](https://raw.githubusercontent.com/vnniz/auth_email/main/server/php/releases/v0.0.5.zip) and modify `config.php` in `src` directory with your own configurations. Example:\n  \n``` php\n// This is a simple configs, you can modify more configs in `index.php`.\n$HOST = 'example.com';\n$USER_NAME = 'auth@example.com';\n$PASSWORD = 'password';\n$PORT = 587;\n$SEND_FROM = $USER_NAME;\n\n$DEFAULT_SUBJECT = 'Verify Email';\n$DEFAULT_BODY = 'Please use this OTP to verify your email for the \u003cb\u003e{appName}\u003c/b\u003e, do not share this code to anyone: \u003cb\u003e{otp}\u003c/b\u003e';\n$DEFAULT_OTP_LENGTH = 6;\n\n// client key: authemailtestkey\n$SERVER_SHA256_KEY = '6955c3a2dbfd121697623896b38f5eb759d2cd503476980e14b9beb0cc036c4d';\n\n// Security of your applications.\n$ALLOWED_APPS = [\n    // Name of application. Must be the same as `appName` on client side.\n    'Auth Email Test' =\u003e [\n        // Allow this app using modified subject or not.\n        'modifiedSubject' =\u003e false,\n        // Allow this app using modified body or not.\n        'modifiedBody' =\u003e false,\n        // Allow this app using modified otp length or not.\n        'modifiedOtpLength' =\u003e false,\n    ],\n];\n```\n\n* Upload only files in `src` directory to your server.\n\n## Client Side\n\n* Add `auth_email` to your project as dependency.\n* Create a controller for `auth_email`:\n  \n``` dart\nfinal authEmail = AuthEmail(\n    // Name of application. Must be available in the `$ALLOWED_APPS` on server.\n    appName: 'Auth Email Test',\n    // URL of your server.\n    server: 'https://example.com/auth/email',\n    // You client key.\n    serverKey: 'authemailtestkey',\n    // Allow print debug log or not.\n    isDebug: true,\n);\n```\n\n* Send OTP code to your client email:\n\n``` dart\nfinal bool result = await authEmail.sendOTP(email: 'exampleclient@gmail.com');\n```\n\nYou can also change email `subject`, `body` and `otpLength` by its parameters as you want to, but you have to change the permissions on your php server config to `true` first.\n\n* Verify OTP code:\n\n``` dart\nfinal bool isVerified = authEmail.verifyOTP(email: 'exampleclient@gmail.com', otp: '\u003ccode\u003e');\n```\n\n## Additional\n\nYou can check the email is valid or not before sending OTP code by using:\n\n``` dart\nfinal bool isValidEmail = AuthEmail.isValidEmail('exampleclient@gmail.com');\n```\n\n## Test Server\n\n* This project include a test server, you can create your own test app with this test sever by using this configuration:\n  \n  ```dart\n  // This only use for testing purposes.\n  final authEmail = AuthEmail(\n    appName: 'Auth Email Example', // \u003c- For testing, only this app name is allowed\n    server: 'https://pub.lamnhan.dev/auth-email/api/v0.0.5',\n    serverKey: 'ohYwh',\n  );\n  ```\n\n* You can also test this plugin on [web](https://pub.lamnhan.dev/auth-email).\n* Please use this config for testing only.\n\n## Contributions\n\n* Feel free to file an issue if you find any bugs or something is missing, PR is also welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamnhan066%2Fauth_email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamnhan066%2Fauth_email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamnhan066%2Fauth_email/lists"}