How to get session when okta authenticates the application

I did follow the below and got my application working.

But I couldnt get the session once the user is authenticated.
I am using ServletFilter to navigate to okta login page(via /authorize endpoint), but i am not getting session in doFilter method.

I am using Primefaces for my UI.

Here is my sample code. In ServletFilter class… it comes here, but return session always empty.

public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
HttpSession httpSession = httpServletRequest.getSession(false); // return null here

This is the code in doFilter where I navigate to okta login page.<host>:8192/app

I created my own http session in the application and killed it when i logout. Got killed okta session by calling /logout endpoint.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.