Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect from oauth service striping headers & cookies #1368

Open
ngigiwaithaka opened this issue May 26, 2020 · 1 comment
Open

Redirect from oauth service striping headers & cookies #1368

ngigiwaithaka opened this issue May 26, 2020 · 1 comment

Comments

@ngigiwaithaka
Copy link

ngigiwaithaka commented May 26, 2020

Hi,

Is there a way to redirect the headers received from a callback originating from a OAuth Server?

I have tried basic redirection, and also using ReDirector + Extractor, but they all strip away the headers & cookies as they redirect....

I have resorted to encoding the same as query values. Is there a better and more secure way than below?

Redirector redirector = new Redirector(getContext(), "", Redirector.MODE_CLIENT_TEMPORARY) { 
			
			@Override
			public void handle(Request request, Response response) {
				final String identifier = request.getAttributes().get("identifier").toString();
				final String accessToken = request.getAttributes().get("accessToken").toString();
				
				//request.getCookies().add("identifier", identifier);
				final String redirectUri = request.getResourceRef().getQueryAsForm().getFirstValue("redirectUri");
				
				final Reference reference = new Reference(redirectUri);
				reference.addQueryParameter("identifier", identifier);
				reference.addQueryParameter("accessToken", accessToken);
				setTargetTemplate(reference.getIdentifier());

				super.handle(request, response);
			}
		};
@cyberquarks

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants