Read query parameter from URL in doFilter | Community
Skip to main content
Level 2
December 16, 2021
Solved

Read query parameter from URL in doFilter

  • December 16, 2021
  • 1 reply
  • 879 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijayalakshmi_S

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. 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
December 16, 2021

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.