Skip to content

Commit

Permalink
If authority segments <3, throw
Browse files Browse the repository at this point in the history
  • Loading branch information
bgavrilMS committed Nov 6, 2024
1 parent d00ce0d commit 37930fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/internal/oauth/ops/authority/authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceD
cannonicalAuthority := authority

// suffix authority with / if it doesn't have one
if !strings.HasSuffix(authority, "/") {
if !strings.HasSuffix(cannonicalAuthority, "/") {
cannonicalAuthority += "/"
}

Expand All @@ -376,7 +376,7 @@ func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceD
}

pathParts := strings.Split(u.EscapedPath(), "/")
if len(pathParts) < 2 {
if len(pathParts) < 3 {
return Info{}, errors.New(`authority must be an URL such as "https://login.microsoftonline.com/<your tenant>"`)
}

Expand Down

0 comments on commit 37930fb

Please sign in to comment.