Skip to content

Commit

Permalink
Merge pull request #173 from manicminer/bugfix/oidc-checks
Browse files Browse the repository at this point in the history
Add missing checks for enabling OIDC auth
  • Loading branch information
manicminer authored Aug 30, 2022
2 parents 7888a91 + a991ed6 commit 47a0441
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (c *Config) NewAuthorizer(ctx context.Context, api environments.Api) (Autho
}
}

if c.EnableClientFederatedAuth {
if c.EnableClientFederatedAuth && strings.TrimSpace(c.TenantID) != "" && strings.TrimSpace(c.ClientID) != "" && strings.TrimSpace(c.FederatedAssertion) != "" {
a, err := NewClientFederatedAuthorizer(ctx, c.Environment, api, c.Version, c.TenantID, c.AuxiliaryTenantIDs, c.ClientID, c.FederatedAssertion)
if err != nil {
return nil, fmt.Errorf("could not configure ClientCertificate Authorizer: %s", err)
Expand All @@ -71,7 +71,7 @@ func (c *Config) NewAuthorizer(ctx context.Context, api environments.Api) (Autho
}
}

if c.EnableGitHubOIDCAuth {
if c.EnableGitHubOIDCAuth && strings.TrimSpace(c.TenantID) != "" && strings.TrimSpace(c.ClientID) != "" && strings.TrimSpace(c.IDTokenRequestURL) != "" && strings.TrimSpace(c.IDTokenRequestToken) != "" {
a, err := NewGitHubOIDCAuthorizer(context.Background(), c.Environment, api, c.TenantID, c.AuxiliaryTenantIDs, c.ClientID, c.IDTokenRequestURL, c.IDTokenRequestToken)
if err != nil {
return nil, fmt.Errorf("could not configure GitHubOIDC Authorizer: %s", err)
Expand Down

0 comments on commit 47a0441

Please sign in to comment.