Skip to content

Commit

Permalink
fix: Handle token audience with trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
andyrobbins committed Apr 21, 2023
1 parent 2e39b1c commit 30a8b77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package config

import (
"strings"

"github.com/bloodhoundad/azurehound/v2/constants"
)

Expand Down Expand Up @@ -80,7 +82,7 @@ func GraphUrl(region string, defaultUrl string) string {
}

func (s Config) GraphUrl() string {
return GraphUrl(s.Region, s.Graph)
return strings.TrimSuffix(GraphUrl(s.Region, s.Graph), "/")
}

func ResourceManagerUrl(region string, defaultUrl string) string {
Expand All @@ -101,5 +103,5 @@ func ResourceManagerUrl(region string, defaultUrl string) string {
}

func (s Config) ResourceManagerUrl() string {
return ResourceManagerUrl(s.Region, s.Graph)
return strings.TrimSuffix(ResourceManagerUrl(s.Region, s.Graph), "/")
}
2 changes: 1 addition & 1 deletion client/rest/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func ParseAud(accessToken string) (string, error) {
} else if aud, ok := body["aud"].(string); !ok {
return "", fmt.Errorf("invalid 'aud' type: %T", body["aud"])
} else {
return aud, nil
return strings.TrimSuffix(aud, "/"), nil
}
}

Expand Down

0 comments on commit 30a8b77

Please sign in to comment.