providers/proxy: add token support for basic auth

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2023-02-07 22:50:49 +01:00
parent 555b33c252
commit 3170b2f92c
4 changed files with 12 additions and 2 deletions

View File

@ -14,7 +14,15 @@ type TokenResponse struct {
IDToken string `json:"id_token"`
}
const JWTUsername = "goauthentik.io/token"
func (a *Application) attemptBasicAuth(username, password string) *Claims {
if username == JWTUsername {
res := a.attemptBearerAuth(password)
if res != nil {
return &res.Claims
}
}
values := url.Values{
"grant_type": []string{"client_credentials"},
"client_id": []string{a.oauthConfig.ClientID},