Authentication

AppKickstarter simplifies authentication and user management using Firebase authentication, providing ready-to-use login and sign-up features.

AppKickstarter simplifies authentication and user management using Firebase authentication, providing a ready-to-use login and sign-up screen with various account management functions like logging in, signing up, resetting forgotten passwords (sent via email), and logging out (navigating back to the login page from the settings screen).

Firebase authentication

Our app template offers a pre-built login and sign up screen with Firebase provider that is readily available for use. Simply display the composable and it will function seamlessly.

To make this works you need to enable Firebase authentication.

Email Password

After enabling Firebase Authentication if you want Email Password authentication, you just have to enable email/password authentication in Firebase.

By default AppKickstarter provides ready to use authentication feature and screens with Email/Password and provides a reset password screen:

Google Sign in

Almost everything is ready in AppKickstarter to enable Google Sign in. You just need to follow these little configuration steps:

Firebase

Enable Google sign in in Firebase.

Android

Get the SHA1 with ./gradlew signingReport

Open the GCP console: https://console.cloud.google.com/apis/credentials

Update the the local.properties with the client id for Android.

google_server_client_id_for_android=yourclientid.apps.googleusercontent.com

iOS

Update the the local.properties with the client id for iOS.

google_server_client_id_for_ios=yourclientid.apps.googleusercontent.com

Then, in XCode, you have to add the reversed client id that you can find in your GoogleService-Info.plist. Select your app from the TARGETS section, then select the Info tab, and expand the URL Types section. Copy the value of that key, and paste it into the URL Schemes box on the configuration page. Leave the other fields untouched.

For more informations follow the guide here.

Custom Authentication without Firebase

You can customize the login and sign up logic while still utilizing the pre-built UI by implementing the following code in Kotlin:

var isSignUp by remember { mutableStateOf(false) }

LoginAndSignupScreen(
    isSignUp = isSignUp,
    createAccount = { email, password ->
        authScope.launch { createAccount(email, password) }
    },
    signInWith = { email, password ->
        authScope.launch { signInWith(email, password) }
    },
    resetPassword = { emailToReset -> 
        scope.launch {
            auth.resetPassword(emailToReset)
        }
    }
)

This allows you to manipulate the email and password according to your specific needs.

Last updated