go-oauth2 / oauth2

OAuth 2.0 server library for the Go programming language.
https://pkg.go.dev/github.com/go-oauth2/oauth2/v4
MIT License
3.31k stars 563 forks source link

It's not possible to differentiate between confidential and public oauth2 clients? #232

Closed jarlandre closed 1 year ago

jarlandre commented 1 year ago

ref https://oauth.net/2/client-types/

This oauth2 server implementation is not allowing to store nor treats confidential clients differently from public.

This is a problem, and is also the reason why its not possible to make public only clients that only can use auth flow code grant with PKCE, without fixing it like i did in https://github.com/go-oauth2/oauth2/pull/230. Which basically circumvents this by allowing to set a secret on a client, and at the same time allowing secret-less auth code flow. Without my suggested fix, if you set secret to blank or nil value, you will be able to request a token from the token endpoint with client_credentials grant, without even passing in the secret, which is horrendous

EDIT: remade the #230 PR into a new PR #234

jarlandre commented 1 year ago

fixed by https://github.com/go-oauth2/oauth2/pull/234