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

security-openid-connect-web-authentication-quickstart fails as Quarkus webpage not found #1461

Open
gtroitsk opened this issue Oct 14, 2024 · 5 comments

Comments

@gtroitsk
Copy link

CodeFlowTest fails after deleting index.html in #1459.

Stack trace

com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 404 Not Found for http://localhost:8081/index.html

	at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:595)
	at com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2277)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:914)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.processPostponedActions(JavaScriptEngine.java:1002)
	at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:1047)
	at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:989)
	at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:897)
	at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:878)
	at com.gargoylesoftware.htmlunit.html.DomElement.click(DomElement.java:859)
	at org.acme.security.openid.connect.web.authentication.CodeFlowTest.testTokenTimeoutLogout(CodeFlowTest.java:71)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:971)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:821)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

Expected Behavior:
The test should successfully access Quarkus main page

@phillip-kruger
Copy link
Member

The test will have to change, index.html is not available in test scope anymore. The test will have to provide it's own page to test against

@gtroitsk
Copy link
Author

gtroitsk commented Oct 16, 2024

@phillip-kruger Quarkus provides dynamic page at http://localhost:8080. I expect that after I set KC auth credentials I can access page, but app gives me an error 403 CORS Rejected - Invalid origin for http://localhost:8080/q/dev-ui/welcome, because of redirection. I tried quarkus.dev-ui.cors.enabled=false, but I have no luck. Can you please give me some hint what should I do?

@phillip-kruger
Copy link
Member

The dynamic page is only available in Dev Mode. So if your test is not a dev mode test, it should return 404. If it's a dev mode test you should get the redirection. quarkus.dev-ui.cors.enabled=false should work from CORS. You can also try and set the origin header in your test. But I would suggest to not test against this and rather include your own test html in your test case app that you test against.

@gtroitsk
Copy link
Author

gtroitsk commented Oct 16, 2024

If I understand your correctly, for this QS we need to get html page back to the state before #1459

@phillip-kruger
Copy link
Member

Any basic HTML file will do, it does not have to be the one from before

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

No branches or pull requests

2 participants