Skip to content

Commit

Permalink
Kerberos auth requires principal for backwards compatibility
Browse files Browse the repository at this point in the history
TestKit backend:
 - Make realm an optional field in TestKit authToken
 - Add feature flags to get these changes tests
  • Loading branch information
robsdedude committed Sep 16, 2021
1 parent ef3725b commit 6f31cba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion testkit-backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,14 @@ func (b *backend) handleRequest(req map[string]interface{}) {
authTokenMap := data["authorizationToken"].(map[string]interface{})["data"].(map[string]interface{})
switch authTokenMap["scheme"] {
case "basic":
var realmString = ""
if realm, ok := authTokenMap["realm"]; ok {
realmString = realm.(string)
}
authToken = neo4j.BasicAuth(
authTokenMap["principal"].(string),
authTokenMap["credentials"].(string),
authTokenMap["realm"].(string))
realmString)
case "kerberos":
authToken = neo4j.KerberosAuth(authTokenMap["ticket"].(string))
default:
Expand Down

0 comments on commit 6f31cba

Please sign in to comment.