[jboss-dev-forums] [Design of Security on JBoss] - how i set one security role in my ejb

stephan.opitz do-not-reply at jboss.com
Tue Sep 19 18:35:48 EDT 2006


i want to set the role in my logic

but how?
i have a login procedure with db access and final, i know which role the user will get...
so i only want to set his role "customer" in ejb - exist there one command?
i look for it but nothing worked

i tried ctx.isCallerInRole("guest");
but get No valid security context for the caller identity

in web.xml i added

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>Test</web-resource-name>
			<url-pattern>/Test/</url-pattern>
		</web-resource-collection>

		<auth-constraint>
			<role-name>Guest</role-name>
			<role-name>Customer</role-name>
		</auth-constraint>

		<user-data-constraint>
			<transport-guarantee>NONE</transport-guarantee>
		</user-data-constraint>
	</security-constraint>

	<security-role>
		Authorized to limited access.
		<role-name>Guest</role-name>
	</security-role>
	<security-role>
		Authorized to access everything.
		<role-name>Customer</role-name>
	</security-role>


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972768#3972768

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972768



More information about the jboss-dev-forums mailing list