by mcav · 14y ago · 0 comments
1. Get a login URL. Send people here to log in.
2. Receive an auth token if the user clicked allow on the login page
3. Swap the auth token for access and renewal tokens.
Optional 4: Maybe renew if you expire.
It's mostly trivial things last I looked (comma delimited scopes instead of space delimited, `expires` instead of `expires_in`, and so on). Glancing over the final spec, seems headers are preferred now (which is almost always dumb IMO, but that's a whole separate rant) and Facebook only does query strings.
Looks as though the spec bloated a bit, though there's probably still a sane-ish kernel worth implementing in there compared to OAuth 1.0a.
It seems easier to me to keep a bearer token secret (out of server and client-side logs/history, etc.) if it doesn't go into the query string -- though certainly it's easier for developers using your API if they can explore it with just a browser.
In general though, I think the ease of development that comes from query strings trumps any supposed security gains of using headers for passing parameters.
Fundamentally, if you're worried about secrets being logged you're worried about MITM attacks (if either endpoint stores secrets insecurely, that's a whole other concern). If someone's actually managed to MITM a user, it's no harder to capture headers than query strings; so it's a mostly false sense of security. To prevent MITMs, you should just mandate HTTPS; that gives you some real improvement, not just one for the very narrow "traffic logs subsequently compromised" case (and even that assumes the log in question isn't capturing headers, which may be typical but is by no means universal).