Expand my Community achievements bar.

SOLVED

Read query parameter from URL in doFilter

Avatar

Level 2

Hi,

 

We have integrated AEM apps with Okta and to resolve one the issue when user got access at Okta but not in AEM due to saml connection between AEM and Okta. We added parameter in URL when user is redirecting from other application (outside from AEM) and trying to read the parameter in doFilter at Access Check Filter but it is returning null values at doFilter.

 

Anyone can let me know is there any way to read those parameter preferable without wrapper. Also, we tried to read via sling request and http request.

 

String queryString = ((HttpServletRequest) request).getQueryString();  --> null

request.getParameter("request_access") --> null

String queryParameter = slingRequest.getQueryString(); --> null

slingRequest.getParameter("request_access") --> null

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @DivyaTyagi,

With Sling filter scope set to request, I am able to get the queryString via slingRequest.getQueryString()

Cross check 

  • the filter properties
  • Outside this use case of checking the URL that is redirected from other application, check with any of the sites pages itself (with some queryString) to narrow down the cause. 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @DivyaTyagi,

With Sling filter scope set to request, I am able to get the queryString via slingRequest.getQueryString()

Cross check 

  • the filter properties
  • Outside this use case of checking the URL that is redirected from other application, check with any of the sites pages itself (with some queryString) to narrow down the cause.