-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix jaas demos #8689
Fix jaas demos #8689
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,32 +14,30 @@ | |
<bundle-symbolic-name>${project.groupId}.jaas</bundle-symbolic-name> | ||
</properties> | ||
<build> | ||
<pluginManagement> | ||
<!-- pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<groupId>org.eclipse.jetty.ee8</groupId> | ||
<artifactId>jetty-ee8-maven-plugin</artifactId> | ||
<version>${project.version}</version> | ||
<configuration> | ||
<scan>10</scan> | ||
<systemProperties> | ||
<!-- This is for convenience so that the src/etc/login.conf file can stay unmodified when copied to $jetty.home/etc directory --> | ||
<jetty.base>${basedir}/src/main/config/modules/demo.d</jetty.base> | ||
<!-- Mandatory. This system property tells JAAS where to find the login module configuration file --> | ||
<java.security.auth.login.config>${basedir}/src/main/config/modules/demo.d/ee8-demo-login.conf</java.security.auth.login.config> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand ee8 demos are derived from ee9 demos with some Maven magic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. demos cannot be derived from ee9 demos. |
||
<java.security.auth.login.config>${basedir}/src/main/etc/ee8-demo-login.conf</java.security.auth.login.config> | ||
</systemProperties> | ||
<webApp> | ||
<contextPath>/test-jaas</contextPath> | ||
<securityHandler implementation="org.eclipse.jetty.security.ConstraintSecurityHandler"> | ||
<loginService implementation="org.eclipse.jetty.jaas.JAASLoginService"> | ||
<loginService implementation="org.eclipse.jetty.ee8.jaas.JAASLoginService"> | ||
<name>Test JAAS Realm</name> | ||
<loginModuleName>xyz</loginModuleName> | ||
<loginModuleName>ee8-xyz</loginModuleName> | ||
</loginService> | ||
</securityHandler> | ||
</webApp> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</pluginManagement --> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html | ||
|
||
[description] | ||
Setup for jaas demos. | ||
|
||
[environment] | ||
core | ||
|
||
[tags] | ||
demo | ||
|
||
[files] | ||
basehome:modules/demo.d/demo-login.conf|etc/demo-login.conf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line was removed from the eeX versions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. As there can only be a single config file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ee10-xyz { | ||
org.eclipse.jetty.ee10.jaas.spi.PropertyFileLoginModule required | ||
debug="true" | ||
file="${jetty.base}/etc/ee10-demo-login.properties"; | ||
}; | ||
|
||
ee9-xyz { | ||
org.eclipse.jetty.ee9.jaas.spi.PropertyFileLoginModule required | ||
debug="true" | ||
file="${jetty.base}/etc/ee9-demo-login.properties"; | ||
}; | ||
|
||
ee8-xyz { | ||
org.eclipse.jetty.ee8.jaas.spi.PropertyFileLoginModule required | ||
debug="true" | ||
file="${jetty.base}/etc/ee8-demo-login.properties"; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is a core demo having eeX configuration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you look at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this?
All the config files necessary were in the
demo.d
directory and copied to relevant places.Why is now
ee10-demo-login.conf
an exception?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the
ee10-demo-login-conf
file still references modulexyz
but should beee10-xyz
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I made the problem clean in the opening comment of the PR? The problem is that you cannot have more than one jaas config file, so all of the eeX-demo-login.conf files were being ignored. All of the jaas configuration must go into a single file.