| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
| X509AuthoritiesPopulator |
|
| 1.0;1 |
| 1 | /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited |
|
| 2 | * |
|
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 | * you may not use this file except in compliance with the License. |
|
| 5 | * You may obtain a copy of the License at |
|
| 6 | * |
|
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 | * |
|
| 9 | * Unless required by applicable law or agreed to in writing, software |
|
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 | * See the License for the specific language governing permissions and |
|
| 13 | * limitations under the License. |
|
| 14 | */ |
|
| 15 | ||
| 16 | package org.acegisecurity.providers.x509; |
|
| 17 | ||
| 18 | import org.acegisecurity.AuthenticationException; |
|
| 19 | ||
| 20 | import org.acegisecurity.userdetails.UserDetails; |
|
| 21 | ||
| 22 | import java.security.cert.X509Certificate; |
|
| 23 | ||
| 24 | ||
| 25 | /** |
|
| 26 | * Populates the <code>UserDetails</code> associated with the X.509 |
|
| 27 | * certificate presented by a client. |
|
| 28 | * <p> |
|
| 29 | * Although the certificate will already have been validated by the web container, |
|
| 30 | * implementations may choose to perform additional application-specific checks on |
|
| 31 | * the certificate content here. If an implementation chooses to reject the certificate, |
|
| 32 | * it should throw a {@link org.acegisecurity.BadCredentialsException}. |
|
| 33 | * </p> |
|
| 34 | * |
|
| 35 | * @author Luke Taylor |
|
| 36 | * @version $Id: X509AuthoritiesPopulator.java 1496 2006-05-23 13:38:33Z benalex $ |
|
| 37 | */ |
|
| 38 | public interface X509AuthoritiesPopulator { |
|
| 39 | //~ Methods ======================================================================================================== |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Obtains the granted authorities for the specified user.<p>May throw any |
|
| 43 | * <code>AuthenticationException</code> or return <code>null</code> if the authorities are unavailable.</p> |
|
| 44 | * |
|
| 45 | * @param userCertificate the X.509 certificate supplied |
|
| 46 | * |
|
| 47 | * @return the details of the indicated user (at minimum the granted authorities and the username) |
|
| 48 | * |
|
| 49 | * @throws AuthenticationException if the user details are not available or the certificate isn't valid for the |
|
| 50 | * application's purpose. |
|
| 51 | */ |
|
| 52 | UserDetails getUserDetails(X509Certificate userCertificate) |
|
| 53 | throws AuthenticationException; |
|
| 54 | } |