You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by dan <da...@bamlabs.com> on 2013/06/11 23:58:43 UTC

Re: Callout for remember me?

Hi --

Just a follow-up.  I was able to resolve this issue by extending
DefaultWebSecurityManager and overriding createSubject(SubjectContext
subjectContext).  It now has almost the same functionality but allows a
callout to a new method to handle my application-specific initialization for
remember me sessions.

The key change in createSubject() were these lines:

		final boolean before = context.getPrincipals() == null;
		context = resolvePrincipals(context);

		Subject subject = doCreateSubject(context);

		if (before && context.getPrincipals() != null)
		{
			Object o = context.getPrincipals().getPrimaryPrincipal();
			if (o instanceof String)
			{
				onSuccessfulRememberMeLogin(subject, (String) o);
			}
		}

The new method is:

	private void onSuccessfulRememberMeLogin(Subject subject, String username)

Hope this helps,
Dan





--
View this message in context: http://shiro-user.582556.n2.nabble.com/Callout-for-remember-me-tp4610313p7578834.html
Sent from the Shiro User mailing list archive at Nabble.com.