
Learn the difference between authentication and authorization, where authentication verifies who you are and authorization governs access, using ID tokens, access tokens, and the OpenID Connect and OAuth frameworks.
Understand how ID tokens from OpenID Connect prove user authentication and enable secure access to server endpoints through JWT claims like audience and issuer.
Explain how an access token enables delegated authorization to access user resources, with scopes defining allowed actions, and secure JWTs kept confidential among the app, authorization server, and resource server.
Learn how oauth 2.0 delegates user authentication to service providers and issues access tokens with scopes. Discover OpenID Connect as an identity layer that delivers ID tokens (JWT) for sign-on.
Explore JSON web tokens (JWT), an open standard for securely transmitting information, detailing header, payload, and signature, and explain information exchange and authorization uses with signing algorithms.
Learn how a server-side session ID is issued after verifying a Google ID token to authenticate users, authorize access to protected endpoints, and how cookies handle client-side data.
Implement one tap sign in for Android with the Google One Tap API, using the bottom sheet to list connected accounts and configuring filter by authorized accounts.
Android Application
https://github.com/stevdza-san/GoogleAuthApp
Ktor Server
https://github.com/stevdza-san/GoogleAuthServer
Source code: https://github.com/stevdza-san/GoogleAuthApp
Preview the two-screen Android design—login and profile—with dark and light themes, one-tap Google sign-in, and custom ui components, updating first and last name on a backend MongoDB via Ktor.
Connect to Google Cloud Platform to generate client API keys and configure credentials for Android and web, including OAuth client IDs and the SHA-1 certificate fingerprint.
Create a custom Google button as a composable with idle text signing with Google and loading state please wait, featuring an icon, shape, border, and a circular progress indicator.
Build a login screen in an android app using Jetpack Compose, featuring a top bar, a message bar, Google sign-in button, and a reusable login content with state handling.
Implement data store operations and a repository to persist and read a boolean sign-in state using a data store preference and a flow-based read.
Develop and observe a login view model that manages sign-in state and message state using a repository and data store, enabling the login screen to reflect persistent sign-in changes.
Implement two Android one-tap authentication functions—sign in and sign up—using Google ID tokens, server client IDs, and account filtering to streamline sign-in.
Implement start activity for result in Jetpack Compose using remember launcher for activity result to handle one tap sign-in. Extract credentials and token ID to send to the backend server.
Implement and demonstrate one-tap Google sign-in to retrieve a token ID on the login screen, update sign-in state, handle account not found errors, and decode the JWT to inspect claims.
Source code: https://github.com/stevdza-san/GoogleAuthServer
Install and test a root route and endpoints in a Ktor backend using Postman. Run the application class to start the server and view the welcome message.
Install and configure a server-side session plugin, verify Google token ID, store user data on the server, and issue a cookie-based session for the Android app.
Create an authorized route that authenticates users, establishes a session cookie, and returns a serialized API response for secured endpoints in a Ktor server.
Verify the token ID using Google ID token verifier with audience and issuer checks, parsing an API request containing the token ID and returning a verified token or unauthorized.
Download the MongoDB community server and install it locally, then open MongoDB campus to interact with your databases. When deploying on Heroku later, switch to MongoDB Atlas.
Watch the last section of this course so you can check out the newest update about Koin plugin. We no longer need to use a custom plugin with Ktor 2.0+
Define a user data model with id, name, email, profile photo, and implement a MongoDB based user data source with get by id, save, delete, and update operations.
Implement the get user info route with token verification to fetch the user's id and name from the server database via the user data source, populating the Android profile screen.
Create a secure delete user route on a Ktor server to remove authenticated users from MongoDB, handling sessions and API responses.
Implement a sign out route to clear the user session, return a success API response with status OK, and delete the session cookie in a Ktor server backed by MongoDB.
Create a Ktor API interface for the Android app, defining endpoints for token verification, get user info, update user, delete user, and clear session with retrofit.
Implement repository methods to interact with the Occator API by adding suspend functions for verify token, get user, update user, delete user, and clear session.
Create the profile screen top bar with a title and two actions, including a save action and a delete account dropdown, implemented as composable functions for the profile screen.
Learn to display an alert dialog in a profile screen using a composable, wiring a delete account action with an open dialogue state and yes/no choices.
Fetch user data from the backend to populate the profile screen by implementing a profile view model that retrieves first name, last name, and email from MongoDB, handling API responses.
Update user information from the Android app via the profile view model by validating fields and sending updates to the backend server and MongoDB, with loading indicator and success message.
Implement the delete user flow in the Android app, updating session and API responses, handling errors, and navigating back to login after removing the user from MongoDB on the server.
configure window soft input mode adjust resize to prevent keyboard overlap and ensure field interaction; create a night mode themes.xml to apply a black status bar for dark theme.
Connect your Android app to a cloud MongoDB Atlas database by configuring the Atlas cluster, obtaining a connection string, and setting it as a Heroku environment variable on the server.
Migrate the Android app to coil async image loading with data, crossfade, placeholders, and a circle crop transformation. Refresh dependencies and fix deprecated retrofit usage, then run the app.
Update #2 updates server dependencies and performs code cleanup, introducing a call logging package and replacing the custom plugin with the Koin library, ensuring the server compiles.
In this course I'm going to teach you how to successfully authenticate your users, and create you own user database on the back-end server, all by yourself. This course project will include a Mongo DB on our back-end, where you'll learn how to execute all CRUD operations from an Android application.
You don't need a Firebase anymore, because with this course you'll get the necessary knowledge to establish a secure communication between your Android application and the back-end server. At the start of this course I will introduce you with some important concepts which we are going to use throughout this course, like the difference between Authentication and Authorization, ID Token and Access Token, OAuth and Open ID Connect, Sessions and Cookies, JSON Web Token and One-Tap Sign in for Android.
You will be able to see how that communication will look like behind the scenes, and we are going authenticate our users using their Google account. In Android app, as a new sign in mechanism, One-Tap for Android will be implemented as well.
We will create a rather simple project, so that you can easily follow up this course, and learn everything you need, that later you become qualified to create more complex applications, that include authenticate mechanism and your own user database.
We are going to use the newest technologies and API's in this project like: Jetpack Compose, Ktor 2.0, One-Tap Sign in for Android and Mongo DB.