DEV Community

Cover image for The Login Button That Also Filled In Your Profile
Amitesh0512
Amitesh0512

Posted on • Originally published at amiteshsurwar.com

The Login Button That Also Filled In Your Profile

MockEvalio has three "continue with" buttons on its login page: Google, GitHub, LinkedIn. Two of them do exactly one thing. The third does two.

What Google and GitHub actually do

Shipped together on March 14, both work identically once you look past the provider name. Google verifies an ID token; GitHub exchanges an authorization code and calls its user/emails API. Both hand off to the same function — find the user if they exist, create them if they don't, attach a profile and a subscription, done. Neither pulls anything from the provider beyond an identity and an email address. That's the whole feature, and it's the same feature twice.

What LinkedIn does differently

Added about two and a half hours later, LinkedIn's login starts the same way — an OIDC flow requesting the standard openid, profile, and email scopes, nothing exotic. But it doesn't stop at logging someone in. It reads the headline text from the LinkedIn profile and uses it to fill in two fields on the user's MockEvalio profile — target role and bio — and it goes one step further than that: it splits the headline on the | character and stores each resulting piece as an imported skill. If your LinkedIn headline reads "Backend Engineer | Node.js | PostgreSQL | AWS," MockEvalio now has three skills it didn't have to ask you for.

It's worth being precise about how unsophisticated that mechanism actually is. This isn't a call to LinkedIn's structured profile API for a real skills list — LinkedIn's OAuth scopes don't expose that kind of data to begin with. It's a plain string split on a punctuation character, applied to whatever text happens to be in someone's headline. It works when a headline is written like a pipe-separated list, which many are, and it produces something closer to noise when it isn't. The mechanism is simple enough to read in full in under a minute, and it's also genuinely useful when it works — a new user's profile isn't empty on day one, without them typing anything.

What isn't in the commit

What I don't have a record of is why LinkedIn got this extra scope and Google and GitHub didn't. It could have been the plan from the start — LinkedIn headlines carry a kind of professional shorthand that a Google or GitHub identity doesn't, so treating it differently makes sense on its face. Or it could be something that only became obvious after Google and GitHub were already working and I was looking at what LinkedIn's OIDC response actually contained. I also don't know whether the headline-split approach was meant to be a real solution or a fast first pass I intended to come back to. And I don't know why LinkedIn shipped as its own commit two and a half hours after Google and GitHub landed together, rather than all three going in at once.

What the code shows plainly enough: three OAuth providers, wired through the same login flow, and one of them quietly doing more than authenticate someone. Whether that was a deliberate design choice or something that fell out of what the data happened to make possible isn't something I can answer just by reading the commit.

Top comments (0)