Welcome to the jGuard's wiki » jGuard Documentation » Subject Template for user registration

Subject Template for user registration

Last modified by RaffaelloPelagalli on 2007/01/17 00:45

what is a SubjectTemplate?

a subject template is the template used to check if a user wich try to register in an application by providing some personal informations provide the right informations(also knwon as credentials).

SubjectTemplate defines 4 credential sets:

  • private required credentials
  • public required credentials
  • private optional credentials
  • public optional credentials
these sets implies two notions:
  • visibility (private/public) : private implies that a permission is required to access to private credentials
  • requirement level (required/optional): required implies that the registration will fail if one or more credentials required are missing in the credentials provided by the 'candidate' user.
it is also used to assign to the successfully registered users, a set of defined roles.

How to grab the DefaultSubjectTemplate?

if the AuthenticationManager is defined, you can get it with the AuthenticationManagerFactory class with its static method getAuthenticationManager.

the AuthenticationManager interface provide the getDefaultSubjectTemplate method to grab it.

AuthenticationManager currentAuthNManager = AuthenticationManagerFactory.getAuthenticationManager();
SubjectTemplate st = currentAuthNManager.getDefaultSubjectTemplate();
//candidate is built with informations sent by the user
SubjectTemplate candidate;
st.validateUser(candidate);
Tags:
Created by diabolo512 on 2006/12/28 03:20

jGuard team copyright 2004-2009
3.1.1