home
Sumuditha Lansakara

Understanding OAuth: The Key to Secure Logins 🔐

Tue Apr 02 2024

We've all been there - scrolling through an app, gotta sign up, but another password ? No thanks! So you click on that "Login with Facebook" button. So easy, but is it safe ? It's actually not so bad! 😄

This is what we called OAuth (don't worry, it's easier than it sounds).

Imagine you're renting a car for a day trip, 🚗

OAuth (Open Authorization)

This is like giving the rental company your entire key ring. They have access to all your keys, including your home and office keys, which isn't good for your security.

OAuth 2.0 (The Updated and Better Way)

This is more secure. But how this works ?

You (the user) want to rent a car from your friend (the rental company) through a trusted service like a car rental platform (the authorization server).

The rental company asks YOU for permission and clarifies what parts of your personal information (like your address or credit card number) the car rental platform can access.

If you agree, the platform grants a temporary 'key' (access token) that only allows the rental company to access specific information (like your driver's license and payment details) and expires after your rental period ends.

Why OAuth 2.0 is better ?

• OAuth 2.0's temporary tokens prevent unauthorized access, unlike OAuth 1.0's potentially long-lasting ones.

• OAuth 2.0 adapts to various platforms like mobile apps and web services.