diff --git a/cmd/ocm/create/idp/cmd.go b/cmd/ocm/create/idp/cmd.go index 54e7df26..62dc1e69 100644 --- a/cmd/ocm/create/idp/cmd.go +++ b/cmd/ocm/create/idp/cmd.go @@ -154,7 +154,7 @@ func init() { &args.googleHostedDomain, "hosted-domain", "", - "Google: Restrict users to a Google Apps domain.\n", + "Google: Restrict users to a Google Apps domain. Example: http://redhat.com (scheme required)\n", ) // LDAP diff --git a/cmd/ocm/create/idp/google.go b/cmd/ocm/create/idp/google.go index e5ee76f7..23e3ce93 100644 --- a/cmd/ocm/create/idp/google.go +++ b/cmd/ocm/create/idp/google.go @@ -81,12 +81,12 @@ func buildGoogleIdp(cluster *cmv1.Cluster, idpName string) (idpBuilder cmv1.Iden ClientSecret(clientSecret) if hostedDomain != "" { - _, err = url.ParseRequestURI(hostedDomain) + hostedDomainParsed, err := url.ParseRequestURI(hostedDomain) if err != nil { return idpBuilder, fmt.Errorf("Expected a valid Hosted Domain: %v", err) } // Set the hosted domain, if any - googleIDP = googleIDP.HostedDomain(hostedDomain) + googleIDP = googleIDP.HostedDomain(hostedDomainParsed.Hostname()) } // Create new IDP with Google provider