A few operating stumbles in 2022 have convinced Wall Street to focus largely on Okta's (OKTA -0.69%) short-term prospects. The digital identity management provider is in the middle of a rough patch due to slowing growth in a few of its niches. The impact of that slowdown has been compounded by the challenges the company faces integrating a huge acquisition it closed in May 2021. As a result, it looks like Okta's margins will tighten in the near term.

These issues, and the stock price slump they have led to, may have created a great opportunity for investors to pick up Okta shares -- assuming the business can regain the positive momentum it had as recently as late last year. So let's consider where Okta might be headed over the next five years.

A bigger business

Okta is likely to have a much bigger sales footprint in a few years. Sure, its $6.5 billion Auth0 acquisition has created a few headaches in areas like marketing, sales, and branding. "Integrations are always difficult," CEO Todd McKinnon said back in late August when he explained why Okta had underperformed management's fiscal 2023 second-quarter sales targets. But the purchase still puts Okta in a leading position in major cybersecurity and identity management niches. Its sales are on pace to rise by about 40% this fiscal year to $1.8 billion.

The key question over the next few quarters will be whether Okta can begin to return to its prior trend of solid market share gains in the cloud services industry. The increase that it posted in its fiscal Q2 (which ended July 31) fell short on that score. Executives pointed to a weakening economy along with those integration challenges as key reasons why.

However, peers including Palo Alto Networks and Zoom have described strong enterprise spending in recent months. Until Okta can close that operating gap, the stock might remain under pressure.

Okta's earnings and cash flow

Okta also trails Palo Alto Networks and Zoom when it comes to profitability. In fact, it reported an expanding net loss last quarter, while many of its peers showed steady or expanding profit margins.

OKTA Cash from Operations (TTM) Chart

OKTA Cash from Operations (TTM) data by YCharts

In response, Okta plans to slow its hiring and reduce spending over the next several quarters, which will likely put it on a better financial footing next year. Look for it to return to free-cash-flow-positive trends by late fiscal 2023 thanks to these moves.

Looking further ahead

The company is currently reevaluating its fiscal 2026 targets. Previously, management had envisioned Okta crossing the $4 billion annual sales mark by then, which would have required compound annual growth of more than 35% over the next three years. The company also aimed to convert at least 20% of those sales into free cash flow by that time, up from around 2% this year.

Investors will find out more about any downgrades to those forecasts when Okta reports its fiscal Q3 and Q4 results over the next few months. Changes in economic growth rates will impact this outlook, as will any continued challenges with the Auth0 acquisition.

Given all of these questions, it might make sense for investors to take a wait-and-see approach to the stock. Sure, with the stock down by more than 75% in the past 12 months, it's possible that in a few months or years, we might look back on the current price as a screaming buy opportunity. But Okta's outlook is unusually cloudy now, both over the short and long term.

Investors might be able to look past that issue if Okta wasn't also generating net losses today. But the combination of its growing losses and the added growth headwinds make the stock extra risky right now.