Skip to content

Commit

Permalink
Add validations
Browse files Browse the repository at this point in the history
  • Loading branch information
mchavez committed Mar 29, 2024
1 parent cc5e9d5 commit 3d56412
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/baton-okta/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func validateConfig(ctx context.Context, cfg *config) error {
return fmt.Errorf("domain is missing")
}

if cfg.ApiToken == "" {
if cfg.OktaClientId == "" && cfg.ApiToken == "" {
return fmt.Errorf("api token is missing")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func New(ctx context.Context, config map[string]any) (*Okta, error) {
okta.WithOrgUrl(fmt.Sprintf("https://%s", domain)),
okta.WithAuthorizationMode("PrivateKey"),
okta.WithClientId(oktaClientId),
okta.WithScopes(([]string{"okta.users.manage"})),
okta.WithPrivateKey("auth.pem"),
okta.WithScopes(([]string{"okta.myAccount.manage"})),
okta.WithPrivateKey(""),
okta.WithPrivateKeyId(oktaPrivateKey),
)
if err != nil {
Expand Down

0 comments on commit 3d56412

Please sign in to comment.