OKTA SAML with Servlets

Hi Team,

Do we have any documentation of Okta SSO with SAML for servlets. I saw the two examples but they do not use SAML it looks like.
Also I have two questions regarding the servlet samples

  1. My app is not pure web app. It has a servlet based web app but it has a desktop gui client as well which indirectly connects to this web app for authentication, in that case should I use the authn-servlet example or the resource server approach?
    Pls guide.