Skip to content

Commit

Permalink
Fix OIDC token handling in event_dispatcher (#7457)
Browse files Browse the repository at this point in the history
Fix in event_dispatcher token handling
  • Loading branch information
creydr authored Nov 17, 2023
1 parent dc96522 commit 2d1bfb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kncloudevents/event_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func WithTransformers(transformers ...binding.Transformer) SendOption {

func WithOIDCAuthentication(serviceAccount *types.NamespacedName) SendOption {
return func(sc *senderConfig) error {
if serviceAccount != nil && serviceAccount.Name != "" && serviceAccount.Namespace == "" {
if serviceAccount != nil && serviceAccount.Name != "" && serviceAccount.Namespace != "" {
sc.oidcServiceAccount = serviceAccount
return nil
} else {
Expand Down Expand Up @@ -349,7 +349,7 @@ func (d *Dispatcher) createRequest(ctx context.Context, message binding.Message,
if err != nil {
return nil, fmt.Errorf("could not get JWT: %w", err)
}
request.Header.Set("Authorization", fmt.Sprintf("Bearer: %s", jwt))
request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", jwt))
}
}

Expand Down

0 comments on commit 2d1bfb5

Please sign in to comment.