feat(server): allow using client_id & secret from basic auth header in token endpoint

This commit is contained in:
Lakhan Samani 2022-11-16 22:40:45 +05:30
parent f9d2130c65
commit 67be8ae285

View File

@ -64,6 +64,12 @@ func TokenHandler() gin.HandlerFunc {
})
}
// check if clientID & clientSecret are present as part of
// authorization header with basic auth
if clientID == "" && clientSecret == "" && codeVerifier == "" {
clientID, clientSecret, _ = gc.Request.BasicAuth()
}
if clientID == "" {
log.Debug("Client ID is empty")
gc.JSON(http.StatusBadRequest, gin.H{