{"id":20881476,"url":"https://github.com/js-bhavyansh/biometric_auth","last_synced_at":"2026-05-21T04:36:36.996Z","repository":{"id":256007362,"uuid":"852857151","full_name":"js-bhavyansh/Biometric_Auth","owner":"js-bhavyansh","description":"Android app showcasing biometric authentication using Jetpack Biometric and Jetpack Compose for secure login.","archived":false,"fork":false,"pushed_at":"2024-09-08T12:05:12.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T20:16:22.998Z","etag":null,"topics":["android-studio","biometric-authentication","biometric-identification","jetpack-compose","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/js-bhavyansh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-05T14:48:30.000Z","updated_at":"2024-09-08T12:06:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"aab2559c-aeed-41da-8737-66922b2a7ca8","html_url":"https://github.com/js-bhavyansh/Biometric_Auth","commit_stats":null,"previous_names":["bhavyansh03-tech/biometric_auth","js-bhavyansh/biometric_auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/js-bhavyansh/Biometric_Auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBiometric_Auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBiometric_Auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBiometric_Auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBiometric_Auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-bhavyansh","download_url":"https://codeload.github.com/js-bhavyansh/Biometric_Auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FBiometric_Auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33288909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["android-studio","biometric-authentication","biometric-identification","jetpack-compose","kotlin"],"created_at":"2024-11-18T07:25:00.301Z","updated_at":"2026-05-21T04:36:36.979Z","avatar_url":"https://github.com/js-bhavyansh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Biometric Authentication App\n\nThis is a sample Android app implementing biometric authentication using **Jetpack Biometric** library. The app demonstrates how to use the **BiometricPrompt** to handle fingerprint, face recognition, and device credential (PIN, pattern, or password) authentication.\n\n## Features\n- Biometric authentication support for fingerprint and face recognition.\n- Fallback to device credentials (PIN, pattern, or password) if biometric is unavailable or not enrolled.\n- Simple and user-friendly UI built with **Jetpack Compose**.\n- Automatic redirect to settings to enroll biometrics if not set up.\n\n## Requirements\n- **Biometric Support:** Fingerprint or Face recognition hardware\n- **Libraries:**\n  - [Jetpack Biometric](https://developer.android.com/jetpack/androidx/releases/biometric)\n  - [Jetpack Compose](https://developer.android.com/jetpack/compose)\n\n## How to Use\n1. Clone the repository.\n   ```bash\n   git clone https://github.com/Bhavyansh03-tech/Biometric_Auth.git\n   ```\n2. Open the project in Android Studio.\n3. Build and run the project on a physical device (biometric authentication is not supported on emulators).\n\n## Sample Code\nHere's a part of the code that manages the biometric prompt:\n\n```kotlin\nclass BiometricPromptManager(\n    private val activity: AppCompatActivity\n) {\n    private val resultChannel = Channel\u003cBiometricResult\u003e()\n    val result = resultChannel.receiveAsFlow()\n\n    fun showBiometricPrompt(\n        title: String,\n        description: String\n    ) {\n        val manager = BiometricManager.from(activity)\n        val authenticators = if (Build.VERSION.SDK_INT \u003e= 30) {\n            BIOMETRIC_STRONG or DEVICE_CREDENTIAL\n        } else BIOMETRIC_STRONG\n\n        val promptInfo = PromptInfo.Builder()\n            .setTitle(title)\n            .setDescription(description)\n            .setAllowedAuthenticators(authenticators)\n        \n        if (Build.VERSION.SDK_INT \u003c 30) {\n            promptInfo.setNegativeButtonText(\"Cancel\")\n        }\n\n        when(manager.canAuthenticate(authenticators)) {\n            BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE -\u003e {\n                resultChannel.trySend(BiometricResult.HardwareUnavailable)\n                return\n            }\n            BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE -\u003e {\n                resultChannel.trySend(BiometricResult.FeatureUnavailable)\n                return\n            }\n            BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED -\u003e {\n                resultChannel.trySend(BiometricResult.AuthenticationNotSet)\n                return\n            }\n            else -\u003e Unit\n        }\n\n        val prompt = BiometricPrompt(\n            activity,\n            object : BiometricPrompt.AuthenticationCallback() {\n                override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {\n                    resultChannel.trySend(BiometricResult.AuthenticationError(errorCode.toString()))\n                }\n\n                override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {\n                    resultChannel.trySend(BiometricResult.AuthenticationSucceeded)\n                }\n\n                override fun onAuthenticationFailed() {\n                    resultChannel.trySend(BiometricResult.AuthenticationFailed)\n                }\n            }\n        )\n        prompt.authenticate(promptInfo.build())\n    }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Create a new Pull Request.\n\n## Contact\n\nFor questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech) on GitHub or connect with me on [LinkedIn](https://www.linkedin.com/in/bhavyansh03/).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fbiometric_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-bhavyansh%2Fbiometric_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fbiometric_auth/lists"}