Skip to content

Commit

Permalink
fix: enable using custom provider by specifying env var (#1605)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki authored Jun 20, 2022
1 parent 4c5789c commit bf93ff4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/shared/hacks/temp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"io"
"net/http"
"os"

"github.com/redhat-developer/app-services-cli/pkg/core/logging"
kafkamgmtclient "github.com/redhat-developer/app-services-sdk-go/kafkamgmt/apiv1/client"
Expand All @@ -17,7 +18,13 @@ import (
// Temporary hack that we use to determine if
// Our CLI needs to use mas-sso token
func ShouldUseMasSSO(logger logging.Logger, apiUrl string) bool {
req, err := http.NewRequest("GET", apiUrl+"/api/kafkas_mgmt/v1/sso_providers", nil)
finalUrl := apiUrl + "/api/kafkas_mgmt/v1/sso_providers"
externalUrl := os.Getenv("RHOAS_CUSTOM_SSO_PROVIDER_URL")
if externalUrl != "" {
finalUrl = externalUrl
}

req, err := http.NewRequest("GET", finalUrl, nil)
if err != nil {
logger.Debug("Error when fetching auth config", err)
return true
Expand Down

0 comments on commit bf93ff4

Please sign in to comment.