General Actions:
Log-in
Register
Wiki:
jguard
▼
:
Document Index
»
Space:
Doc
▼
:
Document Index
»
Page:
subjectTemplate
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to the jGuard's wiki
»
jGuard Documentation
»
Subject Template for user registration
Wiki source code of
Subject Template for user registration
Last modified by RaffaelloPelagalli on 2007/01/17 00:45
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: 1 what is a SubjectTemplate? 2: 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). 3: 4: SubjectTemplate defines 4 credential sets: 5: - private required credentials 6: - public required credentials 7: - private optional credentials 8: - public optional credentials 9: 10: these sets implies two notions: 11: - visibility (private/public) : private implies that a permission is required to access to private credentials 12: - 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. 13: 14: it is also used to assign to the successfully registered users, a set of defined roles. 15: 16: 1 How to grab the DefaultSubjectTemplate? 17: if the AuthenticationManager is defined, you can get it with the AuthenticationManagerFactory class with its static method ~~getAuthenticationManager~~. 18: 19: the ~~AuthenticationManager~~ interface provide the ~~getDefaultSubjectTemplate~~ method to grab it. 20: 21: {code} 22: AuthenticationManager currentAuthNManager = AuthenticationManagerFactory.getAuthenticationManager(); 23: SubjectTemplate st = currentAuthNManager.getDefaultSubjectTemplate(); 24: //candidate is built with informations sent by the user 25: SubjectTemplate candidate; 26: st.validateUser(candidate); 27: {code}
Menu
Overview
Documentation
Quick start
Architecture
jGuard on JEE
Reference doc
HTML
PDF
Step-by-step tutorial
HTML
PDF
MyEclipse tutorial
jGuard Maven Site
Download
Stable release
Beta release
FAQ
Others
jGuard on sf.net
Team
RoadMap
Logo Contest
Development
Forum
Links