{"id":17219263,"url":"https://github.com/dev-ritik/loginaction","last_synced_at":"2026-04-29T09:31:42.156Z","repository":{"id":69334864,"uuid":"124121246","full_name":"dev-ritik/LoginAction","owner":"dev-ritik","description":"A library to help making login page with firebase","archived":false,"fork":false,"pushed_at":"2018-10-05T21:07:15.000Z","size":330,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-08T23:03:52.901Z","etag":null,"topics":["android","android-library","facebook-login","firebase-auth","firebase-authentication","google-login","loginaction","signing"],"latest_commit_sha":null,"homepage":"","language":"Java","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/dev-ritik.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":"2018-03-06T18:29:17.000Z","updated_at":"2018-11-13T04:33:28.000Z","dependencies_parsed_at":"2023-03-01T13:17:02.928Z","dependency_job_id":null,"html_url":"https://github.com/dev-ritik/LoginAction","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dev-ritik/LoginAction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FLoginAction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FLoginAction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FLoginAction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FLoginAction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-ritik","download_url":"https://codeload.github.com/dev-ritik/LoginAction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FLoginAction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32419807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","android-library","facebook-login","firebase-auth","firebase-authentication","google-login","loginaction","signing"],"created_at":"2024-10-15T03:49:30.290Z","updated_at":"2026-04-29T09:31:42.140Z","avatar_url":"https://github.com/dev-ritik.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoginAction\n\nA library to help making login activity with **Firebase**\n\n**version 1.0**\n\nAlmost all Android Apps have a login activity to allow users to login into their app. \nIt is generally the first activity with which your user interacts with. \nFor that you need to implement some logic to sign in and sign up along with designing a UI for the activity. \nThis requires lots of unproductive and repetitive efforts to make the login smooth while checking and catching various errors and exceptions. \nThere are tons on exceptions which needs to be caught and handled for a proper functional loginActivity.\n\nSimple Login Library helps skip the repetitive work and lets you concentrate on the app logic by providing methods for signing in, when working with \n**Firebase Authentication**. **It provides clear interface methods to catch common exceptions and makes them easily available for you to handle them**\n(_no need to search for possible exceptions over the internet_).\n\nIn short it is a library to help making login activity with [Firebase](https://firebase.google.com/docs/auth/) authentication having:\n * [Email](https://firebase.google.com/docs/auth/android/password-auth)\n * [Facebook](https://firebase.google.com/docs/auth/android/facebook-login)\n * [Gmail](https://firebase.google.com/docs/auth/android/google-signin)\n \n login methods for faster login activity building for android applications on java.\n\n _**You can always use [actual_code](https://github.com/dev-ritik/LoginAction/tree/actual_code) branch\n  to checkout the original code without using this library!.**_\n  \n## Setup\n\n1. For Email and Google login:\n    * Sign up and create a new [Firebase](https://console.firebase.google.com/u/0/).\n    * Enable Facebook, Google, Email providers on the Firebase Dashboard for your app.\n    * For Facebook proceed [here](https://developers.facebook.com/docs/facebook-login/android) while excluding step 2 and 9 (and may be 10)\n    * proceed with the following dependency:\n    \n2. Dependency:\n  * Add the following dependency to your project's build.gradle file:\n\n\n```groovy\nallprojects {\n    repositories {\n\t    maven { url 'https://jitpack.io' }\n\t}\n}\n\n```\n\n  * and this dependency in your app's build.gradle file:\n    \n```groovy\ndependencies {\n    implementation 'com.github.dev-ritik:LoginAction:84b663fe6f'\n}\n```\n\n3. Proceed calling login classes as [here](https://github.com/ritik1991998/LoginAction/blob/master/app/src/main/java/com/example/android/loginaction/LoginActivity.java)\n    * Original methods for logging in is available [here](https://github.com/ritik1991998/LoginAction/blob/actual_code/app/src/main/java/com/example/android/loginaction/LoginActivity.java)\n\n4. Modify your manifest (if using Facebook login) from :\n```xml\n \u003cmeta-data\n            android:name=\"com.facebook.sdk.ApplicationId\"\n            android:value=\"@string/facebook_app_id\"\n            /\u003e\n```\nto\n```xml\n \u003cmeta-data\n            android:name=\"com.facebook.sdk.ApplicationId\"\n            android:value=\"@string/facebook_app_id\"\n            tools:replace=\"android:value\" /\u003e\n```\n5. Check if your:\n* you got your google-services.json file right.\n* Project's build.gradle looks [this](https://github.com/ritik1991998/LoginAction/blob/master/build.gradle)\n* App's build.gradle looks [this](https://github.com/ritik1991998/LoginAction/blob/master/app/build.gradle)\n* Manifest looks [this](https://github.com/ritik1991998/LoginAction/blob/master/app/src/main/AndroidManifest.xml)\n* Your String.xml file has:\n    * facebook_app_id\n    * fb_login_protocol_scheme  \n* _If any dependency added in the library is creating error, you can always add the latest in your app's build.gradle._\n    \n## Usage\n\n2. Methods for:\n* Email register\n```java\n\n        SimpleRegistration register = new SimpleRegistration();\n        register.setOnRegistrationResult(new SimpleRegistration.OnRegistrationResult() {\n            @Override\n            public void resultSuccessful(FirebaseUser registeredUser) {\n                 //registered but not logged in \n            }\n\n            @Override\n            public void sameEmailError(Exception errorResult) {\n                //account exists with same email Id\n            }\n\n            @Override\n            public void networkError(Exception errorResult) {\n                //network error occurred\n            }\n            \n            @Override\n            public void resultError(Exception errorResult) {\n                //some error occurred\n            }\n            \n            @Override\n            public void profileUpdateError(Exception errorResult) {\n                //some error occurred while updating username and/or profile pic\n            }\n            \n            @Override\n            public void resultName(FirebaseUser registeredUser) {\n                //name updated(user already registered)\n            }\n\n            @Override\n            public void resultDp(Uri dpLink) {\n               //DP link updated(user already registered)\n            }\n\n            @Override\n            public void wrongCredentials(String doubtfulCredential, String errorMessage) {\n                //doubtfulCredential : \"email\" or \"password1\" or \"password2\" or \"password1 and password2\"\n                //errorMessage : \"empty\" or \"invalid\" or \"short\" or \"mismatch\"\n                }\n            }\n        });\n        register.attemptRegistration(this, email, password1, password2, userNameString, downloadUrl);\n        \n```\n* Email login\n```java\n\n        SimpleEmailLogin login = new SimpleEmailLogin();\n        login.setOnEmailLoginResult(new SimpleEmailLogin.OnEmailLoginResult() {\n            @Override\n            public void resultSuccessful(FirebaseUser registeredUser) {\n                //login successful : registeredUser\n            }\n\n            @Override\n            public void noAccountFound(Exception errorResult) {\n                //no account found\n            }\n\n            @Override\n            public void invalidCredentials(Exception errorResult) {\n                //wrong password or this is a google or facebook loggededin account\");\n            }\n                        \n            @Override\n            public void resultError(Exception errorResult) {\n                //some error occurred\n            }\n            \n            @Override\n            public void networkError(Exception errorResult) {\n                //network error occurred\n            }\n\n            @Override\n            public void wrongCredentials(String doubtfulCredentials, String errorMessage) {\n                //doubtfulCredentials : \"email\" or \"password\"\n                //errorMessage : \"empty\" or \"invalid\" or \"short\"\n            }\n\n        });\n        login.attemptLogin(this, email, password);\n\n```\n* Password changing\n```java\n        SimpleEmailLogin passwordReset = new SimpleEmailLogin();\n        passwordReset.setOnPasswordChangeResult(new SimpleEmailLogin.OnPasswordChangeResult() {\n            @Override\n            public void resultSuccessful() {\n                //Check your email for a reset link\n            }\n\n            @Override\n            public void noAccountFound(Exception errorResult) {\n                //no account found\n            }\n            \n            @Override\n            public void resultError(Exception errorResult) {\n                //some error occurred\n            }\n\n            @Override\n            public void networkError(Exception errorResult) {\n                //network error occurred\n            }\n            \n            @Override\n            public void wrongEmail(String errorMessage) {\n                //errorMessage : \"empty\" or \"invalid\"\n            }\n        });\n        passwordReset.attemptPasswordReset(email);\n\n```\n* Google login\n```java\n        googleLogin = new SimpleGoogleLogin(this, RC_SIGN_IN_GOOGLE, getString(R.string.default_web_client_id));\n        googleLogin.setOnGoogleLoginResult(new SimpleGoogleLogin.OnGoogleLoginResult() {\n            @Override\n            public void resultSuccessful(FirebaseUser registeredUser) {\n                //login successful\n            }\n            \n            @Override\n            public void signinCancelledByUser(Exception errorResult) {\n                //signin cancelled by user\n            }\n            \n            @Override\n            public void accountCollisionError(Exception errorResult) {\n                //account exists with same email Id\n            }\n\n            @Override\n            public void networkError(Exception errorResult) {\n                //network error occurred\n            }\n            \n            @Override\n            public void resultError(Exception errorResult) {\n                //error occurred\n            }\n        });\n        googleLogin.attemptGoogleLogin();\n        //googleLogin is the instance of SimpleGoogleLogin\n```\n* In onActivityResult\n\n```java\n        @Override\n        public void onActivityResult(int requestCode, int resultCode, Intent data) {\n        super.onActivityResult(requestCode, resultCode, data);\n            if (requestCode == RC_SIGN_IN_GOOGLE) {\n                googleLogin.onActivityResult(requestCode, resultCode, data);\n            }\n        }\n        //googleLogin is the instance of same SimpleGoogleLogin\n```\n* Facebook login (**call it in oncreate method**)\n    - It has an **important limitation** discussed [here](https://github.com/dev-ritik/LoginAction/issues/2)\n\n```java\n        facebookLogin = new SimpleFacebookLogin(this);\n        facebookLogin.setOnFacebookLoginResult(new SimpleFacebookLogin.OnFacebookLoginResult() {\n            @Override\n            public void resultFacebookLoggedIn(LoginResult loginResult) {\n                //Facebook login successful, yet to authenticate Firebase\n            }\n\n            @Override\n            public void resultActualLoggedIn(FirebaseUser registeredUser) {\n                //Facebook and Firebase login successful\n            }\n\n            @Override\n            public void resultCancel() {\n                //Facebook login cancelled\n            }\n\n            @Override\n            public void accountCollisionError(Exception errorResult) {\n                //account already exists with the different sign-in credentials\n            }\n            \n            @Override\n            public void networkError(Exception errorResult) {\n                //network error occurred\n            }\n            \n            @Override\n            public void resultError(Exception errorResult) {\n                //Facebook or Firebase login error\n            }\n        });\n        facebookLogin.attemptFacebookLogin(mloginButton);\n\n        //mloginButton is LoginButton from FacebookButtonBase\n        //facebookLogin is the instance of SimpleFacebookLogin\n```\n* In onActivityResult\n```java\n        @Override\n        public void onActivityResult(int requestCode, int resultCode, Intent data) {\n            super.onActivityResult(requestCode, resultCode, data);\n            if (!(facebookLogin == null)){\n                facebookLogin.onActivityResult(requestCode, resultCode, data);\n            }\n        } \n        //facebookLogin is the instance of same SimpleFacebookLogin\n```\n* **Signout**\n````java\nAuthUI.getInstance().signOut(this);\n````\n\n**Arguments for wrong credentials**\n\n|Method         |library class       |doubtfulCredentials         |errorMessage      |\n|---------------|--------------------|----------------------------|------------------|\n|Registration   |SimpleRegistration  | email                      |empty             |\n|Registration   |SimpleRegistration  | email                      |invalid           |\n|Registration   |SimpleRegistration  | password1                  |empty             |\n|Registration   |SimpleRegistration  | password1                  |short             |\n|Registration   |SimpleRegistration  | password2                  |empty             |\n|Registration   |SimpleRegistration  | password2                  |short             |\n|Registration   |SimpleRegistration  | password1 and password2    |mismatch          |\n|Email login    |SimpleEmailLogin    | email                      |empty             |\n|Email login    |SimpleEmailLogin    | email                      |invalid           |\n|Email login    |SimpleEmailLogin    | password                   |empty             |\n|Email login    |SimpleEmailLogin    | password                   |short             |\n|Password reset |SimpleEmailLogin    |  ----                      |empty             |\n|Password reset |SimpleEmailLogin    |  ----                      |invalid           |\n\n## Contributors\n   \n   - [Ritik kumar](https://github.com/dev-ritik)\n   \n## Contribution\n\n   All contributions are welcome and appreciated. \n   Please open an issue or make a Pull Request, if necessary. \n   This may also include any new error to be caught or any form of feature enhancement. \n   Every constructive criticism is welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-ritik%2Floginaction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-ritik%2Floginaction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-ritik%2Floginaction/lists"}