Java Doc for AuthenticationMethod.java in  » Content-Management-System » dspace » org » dspace » authenticate » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » dspace » org.dspace.authenticate 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.dspace.authenticate.AuthenticationMethod

All known Subclasses:   org.dspace.authenticate.X509Authentication,  org.dspace.authenticate.PasswordAuthentication,  org.dspace.authenticate.LDAPAuthentication,  org.dspace.authenticate.IPAuthentication,
AuthenticationMethod
public interface AuthenticationMethod (Code)
Implement this interface to participate in the stackable authentication mechanism. See the AuthenticationManager class for details about configuring authentication handlers.

Each authentication method provides a way to map "credentials" supplied by the client into a DSpace e-person. "Authentication" is when the credentials are compared against some sort of registry or other test of authenticity.

The DSpace instance may configure many authentication methods, in a "stack". The same credentials are passed to each method in turn until one accepts them, so each method need only attempt to interpret and validate the credentials and fail gracefully if they are not appropriate for it. The next method in the stack is then called.
See Also:   AuthenticationManager
author:
   Larry Stone
version:
   $Revision: 2168 $



Field Summary
final public static  intBAD_ARGS
     User or password is not appropriate for this method.
final public static  intBAD_CREDENTIALS
     User exists, but credentials (e.g. passwd) don't match.
final public static  intCERT_REQUIRED
     Not allowed to login this way without X.509 certificate.
final public static  intNO_SUCH_USER
     User not found using this method.
final public static  intSUCCESS
     Authenticated OK, EPerson has been set.


Method Summary
public  booleanallowSetPassword(Context context, HttpServletRequest request, String username)
     Should (or can) we allow the user to change their password. Note that this means the password stored in the EPerson record, so if any method in the stack returns true, the user is allowed to change it.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed.
public  intauthenticate(Context context, String username, String password, String realm, HttpServletRequest request)
     Authenticate the given or implicit credentials. This is the heart of the authentication method: test the credentials for authenticity, and if accepted, attempt to match (or optionally, create) an EPerson.
public  booleancanSelfRegister(Context context, HttpServletRequest request, String username)
     Predicate, whether to allow new EPerson to be created. The answer determines whether a new user is created when the credentials describe a valid entity but there is no corresponding EPerson in DSpace yet. The EPerson is only created if authentication succeeds.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed.
public  int[]getSpecialGroups(Context context, HttpServletRequest request)
     Get list of extra groups that user implicitly belongs to. Returns IDs of any EPerson-groups that the user authenticated by this request is implicitly a member of -- e.g. a group that depends on the client network-address.

It might make sense to implement this method by itself in a separate authentication method that just adds special groups, if the code doesn't belong with any existing auth method. The stackable authentication system was designed expressly to separate functions into "stacked" methods to keep your site-specific code modular and tidy.
Parameters:
  context - A valid DSpace context.
Parameters:
  request - The request that started this operation, or null if not applicable.

public  voidinitEPerson(Context context, HttpServletRequest request, EPerson eperson)
     Initialize a new EPerson record for a self-registered new user. Set any data in the EPerson that is specific to this authentication method.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed.
public  booleanisImplicit()
     Predicate, is this an implicit authentication method. An implicit method gets credentials from the environment (such as an HTTP request or even Java system properties) rather than the explicit username and password.
public  StringloginPageTitle(Context context)
     Get title of login page to which to redirect. Returns a message key that gets translated into the title or label for "login page" (or null, if not implemented) This title may be used to identify the link to the login page in a selection menu, when there are multiple ways to login.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success.
public  StringloginPageURL(Context context, HttpServletRequest request, HttpServletResponse response)
     Get login page to which to redirect. Returns URL (as string) to which to redirect to obtain credentials (either password prompt or e.g.

Field Detail
BAD_ARGS
final public static int BAD_ARGS(Code)
User or password is not appropriate for this method.



BAD_CREDENTIALS
final public static int BAD_CREDENTIALS(Code)
User exists, but credentials (e.g. passwd) don't match.



CERT_REQUIRED
final public static int CERT_REQUIRED(Code)
Not allowed to login this way without X.509 certificate.



NO_SUCH_USER
final public static int NO_SUCH_USER(Code)
User not found using this method.



SUCCESS
final public static int SUCCESS(Code)
Authenticated OK, EPerson has been set.





Method Detail
allowSetPassword
public boolean allowSetPassword(Context context, HttpServletRequest request, String username) throws SQLException(Code)
Should (or can) we allow the user to change their password. Note that this means the password stored in the EPerson record, so if any method in the stack returns true, the user is allowed to change it.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed. May be null.
Parameters:
  username - Username, if available. May be null. true if this method allows user to change ePerson password.



authenticate
public int authenticate(Context context, String username, String password, String realm, HttpServletRequest request) throws SQLException(Code)
Authenticate the given or implicit credentials. This is the heart of the authentication method: test the credentials for authenticity, and if accepted, attempt to match (or optionally, create) an EPerson. If an EPerson is found it is set in the Context that was passed.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success.
Parameters:
  username - Username (or email address) when method is explicit. Use null forimplicit method.
Parameters:
  password - Password for explicit auth, or null for implicit method.
Parameters:
  realm - Realm is an extra parameter used by some authentication methods, leave null ifnot applicable.
Parameters:
  request - The HTTP request that started this operation, or null if not applicable. One of:SUCCESS, BAD_CREDENTIALS, CERT_REQUIRED, NO_SUCH_USER, BAD_ARGS

Meaning:
SUCCESS - authenticated OK.
BAD_CREDENTIALS - user exists, but credentials (e.g. passwd) don't match
CERT_REQUIRED - not allowed to login this way without X.509 cert.
NO_SUCH_USER - user not found using this method.
BAD_ARGS - user/pw not appropriate for this method




canSelfRegister
public boolean canSelfRegister(Context context, HttpServletRequest request, String username) throws SQLException(Code)
Predicate, whether to allow new EPerson to be created. The answer determines whether a new user is created when the credentials describe a valid entity but there is no corresponding EPerson in DSpace yet. The EPerson is only created if authentication succeeds.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed. May be null.
Parameters:
  username - Username, if available. May be null. true if new ePerson should be created.



getSpecialGroups
public int[] getSpecialGroups(Context context, HttpServletRequest request) throws SQLException(Code)
Get list of extra groups that user implicitly belongs to. Returns IDs of any EPerson-groups that the user authenticated by this request is implicitly a member of -- e.g. a group that depends on the client network-address.

It might make sense to implement this method by itself in a separate authentication method that just adds special groups, if the code doesn't belong with any existing auth method. The stackable authentication system was designed expressly to separate functions into "stacked" methods to keep your site-specific code modular and tidy.
Parameters:
  context - A valid DSpace context.
Parameters:
  request - The request that started this operation, or null if not applicable. array of EPerson-group IDs, possibly 0-length, butnever null.




initEPerson
public void initEPerson(Context context, HttpServletRequest request, EPerson eperson) throws SQLException(Code)
Initialize a new EPerson record for a self-registered new user. Set any data in the EPerson that is specific to this authentication method.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed. May be null.
Parameters:
  eperson - newly created EPerson record - email + information from theregistration form will have been filled out.



isImplicit
public boolean isImplicit()(Code)
Predicate, is this an implicit authentication method. An implicit method gets credentials from the environment (such as an HTTP request or even Java system properties) rather than the explicit username and password. For example, a method that reads the X.509 certificates in an HTTPS request is implicit. true if this method uses implicit authentication.



loginPageTitle
public String loginPageTitle(Context context)(Code)
Get title of login page to which to redirect. Returns a message key that gets translated into the title or label for "login page" (or null, if not implemented) This title may be used to identify the link to the login page in a selection menu, when there are multiple ways to login.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success. title text.



loginPageURL
public String loginPageURL(Context context, HttpServletRequest request, HttpServletResponse response)(Code)
Get login page to which to redirect. Returns URL (as string) to which to redirect to obtain credentials (either password prompt or e.g. HTTPS port for client cert.); null means no redirect.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success.
Parameters:
  request - The HTTP request that started this operation, or null if not applicable.
Parameters:
  response - The HTTP response from the servlet method. fully-qualified URL or null



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.