Secure a (part of a) static Netlify site with Okta based authentication

I have a static website running on Netlify. It was generated with Gatsby.
I have an (external) Okta authentication provider active, where users can login.

How can I secure a specific path of my website (example: /secured_pages/) so the Okta authentication is verified?

This is not really a Netlify question and the folks at Okta can help better, but I think this might answer your question: How to Check If User Logged In - #2 by vijet - Questions - Okta Developer Community

Thank you, although it involves Netlify heavily as well: the webserver needs to be able to secure content.
But I came across a document that might be a solution: Restrict access to your sites with role based redirects

Yes, that’s a Netlify way. But, it doesn’t work with Okta. Since you asked for Okta, I did not go over Netlify Identity.

But in the article it says:

If you prefer, you can also take advantage of role based redirects without Netlify’s Identity feature. Third party authentication providers like Okta and Auth0 provide a JWT that you can use with role based redirects.

Sorry, didn’t read that.

hi @RoeckieTM - i do think that Hrishikesh is right and you might get better insight from the people at Okta on how to use their software to protect your routes. Once you have figured it out, it would be great to hear what worked for you!