user3491456
user3491456

Reputation: 377

OAuth2 without secret

I'm trying to build a OAuth2 provider that won't need any secret token or url_redirect whitelist.

Here's the idea:

That way, we are sure that tokens will always stay on the same domain. No need for secret keys. Is there a flaw in my schema?

Upvotes: 0

Views: 1294

Answers (1)

Vilmantas Baranauskas
Vilmantas Baranauskas

Reputation: 6726

If you are using implicit flow, your scheme has no drawbacks: client_secret makes no sense for implicit flow anyway.

In case of authorization code flow, client_secret serves one additional purpose which is not covered by your scheme: It prevents desktop applications from impersonating other applications. Within a browser, your scheme will work because browser enforces URL check (within postMessage, or via redirect), but it is possible to build a desktop application or a shell-script, which pretends to be client_id=x, gets the authorization code and then exchanges it to access token. client_secret prevents this.

Also note that displaying login screen within an iframe is also a security issue: Other applications may impersonate your iframe and capture user credentials without user noticing that.

Upvotes: 2

Related Questions