It has been a tough year for investors. The S&P 500 last peaked in early January, and the broad-based index has since lost 24% of its value, putting it in a bear market. But some Wall Street analysts view that downturn as a buying opportunity. For instance, Alphabet (GOOG 0.60%) (GOOGL 0.71%) and Okta (OKTA -0.52%) both have a consensus rating of buy among analysts right now.

Better yet, Tigress Financial analyst Ivan Feinseth has a price target of $186 per share on Alphabet, which implies 87% upside. And Oppenheimer analyst Ittai Kidron has a price target of $115 per share on Okta, which implies 114% upside.

Here's why these growth stocks are worth buying today.

Alphabet: A powerbroker in the advertising industry

Alphabet is the parent company of search giant Google, a businesses that commands so much loyalty that it can reasonably be called the gateway to the internet. In fact, Google currently holds more than 90% market share among search engines. But Google also owns the wildly popular online video platform YouTube, which is currently tied with Netflix as the top streaming service as measured by viewing time, according to Nielsen.

Google has used those highly engaging web properties to position itself as a powerbroker in the advertising industry. It collected a stunning 27.5% of global digital ad spend in 2020, and despite tough competition from tech companies like Amazon and Alibaba, Google will still hold 27.5% market share by 2023, according to eMarketer.

Meanwhile, Google is also gaining share in cloud computing. Google Cloud captured 8% of cloud infrastructure spend in the second quarter of 2022, up from 5% in the second quarter of 2019, according to Canalys. One of the drivers behind that success is its leadership in the data cloud market, which itself stems from expertise in analytics and artificial intelligence.

Not surprisingly, Alphabet has delivered stellar financial results like clockwork. Revenue climbed 26% to $278.1 billion in the past year, and free cash flow jumped 11% to $65.2 billion. But investors have good reason to believe that momentum will carry into the coming years.

Looking ahead, eMarketer says global digital ad spend will grow at nearly 10% per year to reach $876 billion by 2026, and Grand View Research estimates cloud computing spend will grow at nearly 16% per year to reach $1.6 trillion by 2030. That puts Alphabet in front of a massive market opportunity, and with shares trading at a reasonable 4.9 times sales -- a discount to the three-year average of 6.8 times sales -- now is a great time to buy this growth stock.

Okta: The most comprehensive identity platform

Okta specializes in identity and access management (IAM), a branch of cybersecurity that seeks to ensure only the right people can access applications and resources at the appropriate time. Its platform allows administrators to enforce contextual access policies based on factors like identity, device, and location, and it leans on artificial intelligence to measure risk and authenticate users.

Okta offers the most comprehensive IAM solution on the market, according to management. Its platform features over 7,000 prebuilt integrations that simplify adoption, making it easy for businesses to integrate identity into workforce applications like Microsoft 365 and Salesforce. Its platform also features developer tools -- acquired from Auth0 last year -- that allow businesses to embed identity into customer applications.

Unfortunately, the Auth0 integration has weighed on Okta's financial performance. Revenue climbed 57% to $1.6 billion over the past year, but free cash flow fell 81% to $23 million. Management recently addressed that issue by restructuring its product portfolio to simplify its go-to-market strategy. Investors should keep an eye on the situation, paying close attention to management's commentary regarding adoption of its customer identity cloud in the coming quarters.

On the other side of its business, Okta recently bolstered its workforce identity cloud with the launch of an identity governance and administration (IGA) product, Okta Identity Governance. That IGA solution simplifies auditing and compliance for customers, and it streamlines identity workflows with automation. Okta Identity Governance is now live in North America, and the global launch is slated for later this year. Also noteworthy, Okta has a privileged access management (PAM) product set to launch a few quarters down the road, further expanding its workforce identity cloud. PAM solutions are focused on securing superuser accounts and other highly privileged accounts.

Collectively, Okta's acquisition of Auth0 and its introduction of IGA and PAM solutions brings its total addressable market to $80 billion, leaving a long runway for growth. And with shares trading at 5.2 times sales -- a steep discount to the three-year average of 28.2 times sales -- now is a great time to buy this stock.