Skip to content

Commit

Permalink
Remove client config usage for response types whitelist authgear#3813
Browse files Browse the repository at this point in the history
  • Loading branch information
IniZio committed Mar 4, 2024
1 parent 4e7b9b0 commit 3cc8270
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkg/lib/oauth/handler/handler_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const (
SettingsActonResponseType = "urn:authgear:params:oauth:response-type:settings-action"
)

// whiteslistedResponseTypes is a list of response types that would be always allowed
// whitelistedResponseTypes is a list of response types that would be always allowed
// to all clients.
var whiteslistedResponseTypes = []string{
var whitelistedResponseTypes = []string{
CodeResponseType,
NoneResponseType,
SettingsActonResponseType,
Expand Down Expand Up @@ -566,14 +566,8 @@ func (h *AuthorizationHandler) validateRequest(
client *config.OAuthClientConfig,
r protocol.AuthorizationRequest,
) error {
allowedResponseTypes := client.ResponseTypes
if len(allowedResponseTypes) == 0 {
allowedResponseTypes = []string{"code"}
}
allowedResponseTypes = append(allowedResponseTypes, whiteslistedResponseTypes...)

ok := false
for _, respType := range allowedResponseTypes {
for _, respType := range whitelistedResponseTypes {
if respType == r.ResponseType() {
ok = true
break
Expand Down

0 comments on commit 3cc8270

Please sign in to comment.