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

Have OIDC DevUI web-app function included with quarkus.oidc.provider #32971

Merged
merged 1 commit into from Apr 28, 2023

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Apr 27, 2023

This is a minor tweak to OIDC DevUI provider.html to have a function dealing with quarkus.oidc.application-type=web-app included in the produced script, when we only have something like quarkus.oidc.provider=google etc.

With quarkus.oidc.provider=google only, the application-type=web-app is set internally on OidcTenantConfig.
Build steps can detect it, but provider.html itself sees info:oidcApplicationType prepared by the build step only if quarkus.oidc.application-type is explicitly set in application.properties. Looks like the scripts are resolved early, before the build step (OidcDevConsoleProcessor) prepares info:oidcApplicationType by fetching the correct value from OidcTenantConfig created from quarkus.oidc.provider=google.

So the solution I've come up with is this, the top branch in provider.html checks if is the type is either service or hybrid and now, instead of also checking if it is web-app I just do else - it can only be web-app in this branch because we only have 3 application types.

And now quarkus.oidc.application-type=web-app is working correctly for quarkus.oidc.provider=google .
This is not a proper fix, kind of a hack, but it is safe nonetheless, it will work fine for explicitly declared quarkus.oidc.application-type.

The other thing is that testing web-app from Dev UI is not useful - since Quarkus is in control of the flow (i.e, once the authentication is complete, the control is not returned back to DevUI, it stays with the browser), but for the purpose of the demo, it can be useful to show it and thus explain why quarkus.oidc.provider=google should have an extra quarkus.oidc.application-type=service (or hybrid) property in application.properties for it to be tested from SPA such as Dev UI

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 27, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@sberyozkin sberyozkin merged commit 2584d87 into quarkusio:main Apr 28, 2023
20 checks passed
@sberyozkin sberyozkin deleted the oidc_ui_web_app_script branch April 28, 2023 08:48
@quarkus-bot quarkus-bot bot added this to the 3.1 - main milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants