Skip to content

Commit

Permalink
fix: authentication issue with Nexus by comparing auth methods lower …
Browse files Browse the repository at this point in the history
…case
  • Loading branch information
afrimberger committed Jul 17, 2019
1 parent 06a0623 commit e00f78f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/v1/registry/client/auth/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ func NewToken(url, username, password, scope string) (Token, error) {
return nil, err
}

method := getAuthMethod(authHeader)
method := strings.ToLower(getAuthMethod(authHeader))
params := getAuthParams(authHeader)

switch method {
case "None":
case "none":
return none.RequestToken()
case "Basic":
case "basic":
t, err := basic.RequestToken(url, username, password)
if err != nil {
log.Debug(err.Error())
Expand All @@ -83,7 +83,7 @@ func NewToken(url, username, password, scope string) (Token, error) {
}

return t, nil
case "Bearer":
case "bearer":
params["scope"] = scope
return bearer.RequestToken(username, password, params)
default:
Expand Down

0 comments on commit e00f78f

Please sign in to comment.