Posted by Niharika Arora – Developer Relations Engineer
From breaking information and leisure to sports activities and politics, X is a social media app that goals to assist practically 500 million customers worldwide get the total story with all of the stay commentary. Just lately, X builders revamped the Android app’s login course of so customers by no means miss out on the conversations they’re concerned with. Utilizing the Credential Supervisor API, the workforce carried out new passkey authentication for faster, simpler, and safer entry to the app.
Simplifying login with passkeys
In the present day, conventional password-based authentication methods are much less safe and extra liable to cyber assaults. Many customers typically select easy-to-guess passwords, which dangerous actors can simply crack utilizing brute pressure assaults. In addition they reuse the identical passwords throughout a number of accounts, that means if one password is hacked, all accounts are compromised.
Passkeys tackle the rising concern of account safety from weak passwords and phishing assaults by eliminating the necessity for passwords completely. The characteristic gives a safer, extra seamless sign-in expertise, liberating customers from having to recollect their usernames or passwords.
“Passkeys are a less complicated, safer strategy to log in, changing passwords with pins or biometric knowledge like fingerprints or facial recognition,” stated Kylie McRoberts, head of security at X. “We explored utilizing passkeys to make signing in simpler and safer for customers, serving to shield their accounts with out the trouble of remembering passwords.”
Since implementing passkeys, the X workforce has seen a considerable discount in login instances and metrics exhibiting improved login stream. With passkeys, the app’s profitable login charge has doubled in comparison with when it solely relied on passwords. The workforce has additionally seen a decline in password reset requests from customers who’ve enabled passkeys.
Based on X builders, adopting passkeys even got here with advantages past enhanced safety and a simplified login expertise, like decrease prices and improved UX.
“Passkeys allowed us to chop down on bills associated to SMS-based two-factor authentication as a result of they provide robust, inherent authentication,” stated Kylie. “And with the benefit of login, customers usually tend to have interaction with our platform since there’s much less friction to recollect or reset passwords.”
Passkeys depend on public-key cryptography to authenticate customers and supply them with personal keys. Which means web sites and apps can see and retailer the general public key, however by no means the personal key, which is encrypted and saved by the consumer’s credential supplier. As keys are distinctive and tied to the web site or app, they can’t be phished, additional enhancing their safety.
Seamless integration utilizing the Credential Supervisor API
To combine passkeys, X builders used Android’s Credential Supervisor API, which made the method “extraordinarily clean,” based on Kylie. The API unifies Sensible Lock, One Faucet, and Google Signal-In right into a single, streamlined workflow. This additionally allowed builders to take away tons of of traces of code, boosting implementation and decreasing upkeep overhead.
In the long run, the migration to Credential Supervisor took X builders solely two weeks to finish, adopted by an extra two weeks to completely assist passkeys. This was a “very quick migration” and the workforce “didn’t count on it to be that straightforward and easy,” stated Saurabh Arora, a employees engineer at X. Because of Credential Supervisor’s easy, coroutine-powered API, the complexities of dealing with a number of authentication choices had been basically eliminated, decreasing code, the chance of bugs, and total developer efforts.
X builders noticed a big enchancment in developer velocity by integrating the Credential Supervisor API. With their shift to passkey adoption via Credential Supervisor API, they achieved an:
- 80% code discount within the authentication module
- 90% decision of legacy edge case bugs
- 85% lower in GIS, One Faucet, and Sensible Lock dealing with code
Utilizing the Credential Supervisor API’s top-level strategies, like createCredential and getCredential, simplified integration by eradicating customized logic complexities surrounding particular person protocols. This uniform strategy additionally meant X builders might use a single, constant interface to deal with varied authentication varieties, reminiscent of passkeys, passwords, and federated sign-ins like Check in with Google.
“With Credential Supervisor’s easy API strategies, we might retrieve passkeys, passwords, and federated tokens with a single name, chopping down on branching logic and making response dealing with cleaner,” stated Saurabh. “Utilizing totally different API strategies, like createCredential() and getCredential(), additionally simplified credential storage, letting us deal with passwords and passkeys in a single place.”
X builders didn’t face many challenges when adopting Check in With Google utilizing the Credential Supervisor API. Changing X’s earlier Google Signal In, One Faucet, and Sensible Lock code with a less complicated Credential Supervisor implementation meant builders not needed to deal with connection or disconnection statuses and exercise outcomes, decreasing the margin of error.
A future with passkeys
X’s integration of passkeys reveals that attaining a safer and user-friendly authentication expertise will be achieved. By leveraging Credential Supervisor API, X builders simplified the mixing course of, decreased potential bugs, and improved each safety and developer velocity—all whereas sharpening the consumer expertise.
“Our recommendation for builders contemplating passkey integration can be to reap the benefits of the Credential Supervisor API,” stated Saurabh. “It actually simplifies the method and reduces code it’s good to write and preserve, making implementation higher for builders.”
Trying forward, X plans to additional improve the consumer expertise by permitting sign-ups with passkeys alone and offering a devoted passkey administration display.
Get began
Discover ways to enhance your app’s login UX utilizing passkeys and the Credential Supervisor API.