Skip to content

Commit 47898ca

Browse files
committed
refactor: validate issuer (url) when retrieving configuration
Closes #26
1 parent a0f233b commit 47898ca

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/FusionAuth/oauth/OAuthAuthorizationService.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ extension OAuthAuthorizationService {
9090
return
9191
}
9292

93+
let scheme = config.issuer?.scheme
94+
if scheme != "http" && scheme != "https" {
95+
continuation.resume(throwing: OAuthError.invalidIssuer)
96+
return
97+
}
98+
9399
continuation.resume(returning: config)
94100
}
95101
}

Sources/FusionAuth/oauth/OAuthErrors.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ enum OAuthError: Error {
99
case refreshTokenNoResponse
1010
case unableToUpdateInternalState
1111
case invalidUserAgent
12+
case invalidIssuer
1213
}

0 commit comments

Comments
 (0)