|
1 | 1 | type=page |
2 | 2 | status=published |
3 | | -title=Java API for Security |
| 3 | +title=About the Java EE Security API |
4 | 4 | next=security-api002.html |
5 | 5 | prev=security-api.html |
6 | 6 | ~~~~~~ |
7 | | -= About the Java API for Security |
8 | | - |
9 | | - |
10 | | - |
11 | | -[[about-the-java-api-for-security]] |
12 | | -About the Java API for Security |
13 | | -------------------------------- |
| 7 | += About the Java EE Security API |
14 | 8 |
|
| 9 | +[[about-the-java-ee-security-api]] |
| 10 | +About the Java EE Security API |
| 11 | +------------------------------ |
15 | 12 |
|
16 | 13 | Java EE includes support for JSR 375, which defines portable, plug-in interfaces |
17 | 14 | for authentication and identity stores, and a new injectable-type SecurityContext |
18 | 15 | interface that provides an access point for programmatic security. You can use |
19 | 16 | the built-in implementations of these APIs, or define custom |
20 | 17 | implementations. |
21 | 18 |
|
22 | | -The Java API for Security contains the following packages: |
| 19 | +The Java EE Security API contains the following packages: |
23 | 20 |
|
24 | 21 | * The `javax.security.enterprise` package is the main Java EE security API package |
25 | 22 | and contains classes and interfaces that span authentication, authorization, and |
26 | 23 | identity concerns. link:#main-classes-and-interfaces-in-enterprise[Table 51-1] lists |
27 | 24 | the main class and interfaces in this package. |
28 | 25 |
|
29 | 26 | * The `javax.security.enterprise.authentication.mechanism.http` package contains |
30 | | -classes and interfaces associated with authentication mechanisms that specifically |
31 | | -target HTTP as an environment to interact with a caller (challenge/response, obtain |
32 | | -credentials). This API is specified only for use in the servlet container. |
| 27 | +classes and interfaces associated with HTTP-based authentication mechanisms that |
| 28 | +can interact with a caller or third-parties as part of an authentication protocol. |
33 | 29 | link:#main-classes-and-interfaces-in-authentication[Table 51-2] lists the main classes |
34 | 30 | and interfaces in this package. |
35 | 31 |
|
36 | 32 | * The `javax.javax.security.enterprise.credential` package contains classes and |
37 | | -interfaces associated with submitting credentials. link:#main-classes-and-interfaces-in-credential[Table 51-3] |
| 33 | +interfaces for representing user credentials. link:#main-classes-and-interfaces-in-credential[Table 51-3] |
38 | 34 | lists the main classes and interfaces in this package. |
39 | 35 |
|
40 | 36 | * The `javax.security.enterprise.identitystore` package contains classes and |
41 | | -interfaces associated with the identity store, which validate the credentials of the |
42 | | -Caller, and access a Caller's identity attributes. link:#main-classes-and-interfaces-in-identitystore[Table 51-4] |
| 37 | +interfaces associated with identity stores that validate a caller's credentials |
| 38 | +and lookup caller groups. link:#main-classes-and-interfaces-in-identitystore[Table 51-4] |
43 | 39 | lists the main classes and interfaces in this package. |
44 | 40 |
|
45 | 41 |
|
| 42 | +
|
46 | 43 | [[main-classes-and-interfaces-in-enterprise]] |
47 | 44 |
|
48 | 45 | *Table 51-1 Main Classes and Interfaces in javax.security.enterprise* |
49 | 46 |
|
50 | | -[width=99%,cols="25%,75%"] |
| 47 | +[width=99%,cols="35%,65%"] |
51 | 48 | |======================================================================= |
52 | 49 | |*Class or Interface* |*Description* |
53 | | -|`SecurityContext` | Injectable-type interface that provides an access point for |
| 50 | + |
| 51 | +|`SecurityContext` |Injectable-type interface that provides an access point for |
54 | 52 | programmatic security intended to be used by application code to query and interact |
55 | 53 | with the Java EE Security API. |
56 | 54 |
|
57 | | -|`CallerPrincipal` | Principal type that represents the identity of the |
| 55 | +|`CallerPrincipal` |Principal type that can represent the identity of the |
58 | 56 | application caller. |
59 | 57 |
|
60 | | -|`AuthenticationStatus` | Enum used as a return value, primarily by the |
61 | | -`HttpAuthenticationMechanism` to indicate the result of the authentication process. |
| 58 | +|`AuthenticationStatus` |Enum used to indicate the return value from an authentication |
| 59 | +mechanism. |
62 | 60 |
|
63 | | -|`AuthenticationException` | Indicates that a problem occurred during the |
| 61 | +|`AuthenticationException` |Indicates that a problem occurred during the |
64 | 62 | authentication process. |
65 | 63 | |======================================================================= |
66 | 64 |
|
67 | 65 | [[main-classes-and-interfaces-in-authentication]] |
68 | 66 |
|
| 67 | + |
69 | 68 | *Table 51-2 Main Classes and Interfaces in javax.security.enterprise.authentication.mechanism.http* |
70 | | -[width=99%,cols="25%,75%"] |
| 69 | +[width=99%,cols="35%,65%"] |
71 | 70 | |======================================================================= |
72 | 71 | |*Class or Interface* |*Description* |
73 | | -|`HttpAuthenticationMechanism` | Interface used to obtain a caller's credentials in some way, |
74 | | -using the HTTP protocol where necessary. |
75 | 72 |
|
76 | | -|`HttpMessageContext` | Interface that contains all of the per-request state |
77 | | -information and encapsulates the client request, server response, |
78 | | -container handler for authentication callbacks, and the subject representing |
79 | | -the caller. |
| 73 | +|`HttpAuthenticationMechanism` |Interface representing an HTTP authentication mechanism. |
| 74 | +Developers can provide their own implementation of this interface, or use one of |
| 75 | +several built-in HTTP authentication mechanisms. |
| 76 | + |
| 77 | +|`HttpMessageContext` |Interface representing the parameters passed to/from methods |
| 78 | +of an `HttpAuthenticationMechanism` at runtime. |
80 | 79 |
|
81 | | -|`AuthenticationParameters` | Parameters that are provided with the authentication |
82 | | -request. |
| 80 | +|`AuthenticationParameters` |Class that carries parameters passed to the |
| 81 | +`SecurityContext.authenticate()` method. |
83 | 82 |
|
84 | | -|`HttpMessageContextWrapper` | Class that is an implementation of the |
85 | | -HttpMessageContext interface that can be subclassed by developers wishing to |
86 | | -provide extra or different functionality. |
| 83 | +|`HttpMessageContextWrapper` |Abstract class developers can extend to |
| 84 | +customize `HttpMessageContext` behavior. |
| 85 | +|======================================================================= |
| 86 | + |
| 87 | +[width="100%",cols="100%",] |
| 88 | +|======================================================================= |
| 89 | +a| |
| 90 | +*Note:* |
| 91 | + |
| 92 | +The 'javax.security.enterprise.authentication.mechanism.http' package also includes |
| 93 | +a number of annotation classes that can be used to configure/enable the built-in |
| 94 | +authentication mechanisms or modify that behavior of an authentication mechanism. |
87 | 95 | |======================================================================= |
88 | 96 |
|
89 | 97 |
|
90 | 98 | [[main-classes-and-interfaces-in-credential]] |
91 | 99 |
|
92 | 100 | *Table 51-3 Main Classes and Interfaces in javax.security.enterprise.credential* |
93 | | -[width=99%,cols="25%,75%"] |
| 101 | +[width=99%,cols="35%,65%"] |
94 | 102 | |======================================================================= |
95 | 103 | |*Class or Interface* |*Description* |
96 | | -|`Credential` | Represents the credential the caller uses to authenticate. |
97 | 104 |
|
98 | | -|`AbstractClearableCredential` | Class that contains behavior common to `credential` |
99 | | -implementations that can be meaningfully cleared. |
| 105 | +|`Credential` |Interface that represents a generic credential and defines |
| 106 | +several methods to operate on credentials. All other classes in this package |
| 107 | +are implementations of the Credential interface. |
| 108 | + |
| 109 | +|`AbstractClearableCredential` |Abstract class implementing behavior common to |
| 110 | +Credentials that can be meaningfully cleared. |
100 | 111 |
|
101 | | -|`BasicAuthenticationCredential` | Class that extends `UsernamePasswordCredential` |
| 112 | +|`BasicAuthenticationCredential` |Class that extends `UsernamePasswordCredential` |
102 | 113 | to represent credentials used by HTTP Basic Authentication. |
103 | 114 |
|
104 | | -|`CallerOnlyCredential` | Class that represents a credential that contains only a |
105 | | -caller name and no secret of any kind. |
| 115 | +|`CallerOnlyCredential` |Credential that contains a caller name only; can be |
| 116 | +used to assert an identity, but not to authenticate a user, due to the lack of |
| 117 | +any secret or other credential that can be validated. |
106 | 118 |
|
107 | | -|`Password` | Class that represents a text-based password, and includes a built-in |
108 | | -mechanism for securely clearing the value. |
| 119 | +|`Password` |Class that represents a text-based password. |
109 | 120 |
|
110 | | -|`RememberMeCredential` | Class that represents a credential presented as a token, |
| 121 | +|`RememberMeCredential` |Class that represents a credential presented as a token, |
111 | 122 | for the explicit usage with the JSR 375 remember me function. |
112 | 123 |
|
113 | | -|`UsernamePasswordCredential` | Class that represents the credentials typically |
| 124 | +|`UsernamePasswordCredential` |Class that represents the credentials typically |
114 | 125 | used by standard caller name/password authentication. |
115 | 126 | |======================================================================= |
116 | 127 |
|
117 | 128 | [[main-classes-and-interfaces-in-identitystore]] |
118 | 129 |
|
119 | 130 | *Table 51-4 Main Classes and Interfaces in javax.security.enterprise.identitystore* |
120 | | -[width=99%,cols="25%,75%"] |
| 131 | +[width=99%,cols="35%,65%"] |
121 | 132 | |======================================================================= |
122 | 133 | |*Class or Interface* |*Description* |
123 | | -|`IdentityStore` | Mechanism for validating a caller's credentials and |
124 | | -accessing a caller's identity attributes. |
125 | 134 |
|
126 | | -|`IdentityStoreHandler` | Mechanism for validating a caller's credentials, |
127 | | -and accessing a caller's identity attributes, by consulting a set of one or more |
128 | | -'IdentityStore's. |
| 135 | +|`IdentityStore` |Interface representing an Identity Store. |
| 136 | +Developers can provide their own implementation of this interface, or use one of |
| 137 | +the built-in Identity Stores. |
| 138 | + |
| 139 | +|`IdentityStoreHandler` |Interface that defines the method applications use to |
| 140 | +interact with Identity Stores. Applications can use the built-in |
| 141 | +IdentityStoreHandler, or supply their own implementation if custom behavior is desired. |
129 | 142 |
|
130 | | -|`PasswordHash` | Interface for objects that can generate and verify password hashes. |
| 143 | +|`PasswordHash` |Interface defining methods for generating and |
| 144 | +validating password hashes, needed to securely validate passwords when using |
| 145 | +the built-in Database Identity Store. Developers can implement this interface |
| 146 | +to generate/validate password hashes using any desired algorithm. |
131 | 147 |
|
132 | | -|`Pbkdf2PasswordHash` | Interface that represents the built-in `Pbkdf2PasswordHash` |
133 | | -implementation. |
| 148 | +|`Pbkdf2PasswordHash` |Marker interface implemented by the built-in PBKDF2 |
| 149 | +PasswordHash implementation. Developers can use this interface to select the |
| 150 | +built-in PBKDF2 algorithm when configuring the Database Identity Store. |
134 | 151 |
|
135 | | -|`RememberMeIdentityStore` | Mechanism for validating a caller's credentials and |
136 | | -accessing a caller's identity attributes. This interface is specifically tailored |
137 | | -for the "remember me" feature. |
| 152 | +|`RememberMeIdentityStore` |Interface defining a special type of Identity Store, |
| 153 | +used in conjunction with the RememberMe annotation to provide RememberMe |
| 154 | +behavior for an application. |
138 | 155 |
|
139 | | -|`CredentialValidationResult` | Class that represents the result from an attempt |
140 | | -to validate an instance of `Credential`. |
| 156 | +|`CredentialValidationResult` |Class that represents the result from an attempt |
| 157 | +to validate a Credential. |
141 | 158 |
|
142 | | -|`IdentityStorePermission` | Class for IdentityStore permissions. The permission |
143 | | -name currently defined is `getGroups`. |
| 159 | +|`IdentityStorePermission` |Permission required to invoke the `getGroups` method of an |
| 160 | +IdentityStore, when a SecurityManager is configured. |
144 | 161 | |======================================================================= |
0 commit comments