Allow public clients created with API to have no client_secret (#1871)

Signed-off-by: Steffen Pøhner Henriksen <str3sses@gmail.com>
This commit is contained in:
Steffen Pøhner Henriksen 2021-02-19 10:18:54 +01:00 committed by GitHub
parent 86ea49173c
commit 0f68fadb9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ func (d dexAPI) CreateClient(ctx context.Context, req *api.CreateClientReq) (*ap
if req.Client.Id == "" { if req.Client.Id == "" {
req.Client.Id = storage.NewID() req.Client.Id = storage.NewID()
} }
if req.Client.Secret == "" { if req.Client.Secret == "" && !req.Client.Public {
req.Client.Secret = storage.NewID() + storage.NewID() req.Client.Secret = storage.NewID() + storage.NewID()
} }