Reply To: [Solved] PrettyFaces & JAAS problem

Splash Forums PrettyFaces Users [Solved] PrettyFaces & JAAS problem Reply To: [Solved] PrettyFaces & JAAS problem

#26295

Nasicus
Participant

Yeah! I found a solution. It’s pretty simple.

Let’s say you have the following prettyface mappings which you want to work BEFORE you have authenticated with JAAS:


	<url-mapping id="login">
		<pattern value="/login/#{login}/#{pass}" />
		<view-id value="/login.xhtml" />
	</url-mapping>

	<url-mapping id="loginError">
		<pattern value="/loginerror" />
		<view-id value="/login.xhtml?HasError=true" />
	</url-mapping>

To make this work you just add it to the unprotected area:


....
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>Unprotected Area</web-resource-name>
			<url-pattern>/resources/*</url-pattern>
			<url-pattern>/javax.faces.resource/*</url-pattern>
			<url-pattern>/login/*</url-pattern>
                        <url-pattern>/loginerror</url-pattern>
		</web-resource-collection>
	</security-constraint>
.... 

Note that if you have parameters (as I have in the first rule) you have to add “/*” to the url pattern and if it’s just a prettyurl without paramters, you don’t have too 🙂