From 7bc966217d9db99eddd7a0b97208c0b6edb4716f Mon Sep 17 00:00:00 2001
From: ariary <ariary9.2@hotmail.fr>
Date: Wed, 6 Oct 2021 08:29:14 -0400
Subject: [PATCH] sort grant type supported

Signed-off-by: ariary <ariary9.2@hotmail.fr>
---
 server/handlers.go | 1 -
 server/server.go   | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/handlers.go b/server/handlers.go
index cbdf5f5b..37a1f9ac 100755
--- a/server/handlers.go
+++ b/server/handlers.go
@@ -110,7 +110,6 @@ func (s *Server) discoveryHandler() (http.HandlerFunc, error) {
 	sort.Strings(d.ResponseTypes)
 
 	d.GrantTypes = s.supportedGrantTypes
-	sort.Strings(d.GrantTypes)
 
 	data, err := json.MarshalIndent(d, "", "  ")
 	if err != nil {
diff --git a/server/server.go b/server/server.go
index 619a358f..ecd6c935 100755
--- a/server/server.go
+++ b/server/server.go
@@ -11,6 +11,7 @@ import (
 	"net/url"
 	"os"
 	"path"
+	"sort"
 	"strconv"
 	"strings"
 	"sync"
@@ -225,6 +226,7 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
 	if c.PasswordConnector != "" {
 		supportedGrant = append(supportedGrant, grantTypePassword)
 	}
+	sort.Strings(supportedGrant)
 
 	webFS := web.FS()
 	if c.Web.Dir != "" {
-- 
GitLab