All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jakarta.security.auth.message.config.ClientAuthContext Maven / Gradle / Ivy

Go to download

Jakarta Authentication defines a general low-level SPI for authentication mechanisms, which are controllers that interact with a caller and a container's environment to obtain the caller's credentials, validate these, and pass an authenticated identity (such as name and groups) to the container. Jakarta Authentication consists of several profiles, with each profile telling how a specific container (such as Jakarta Servlet) can integrate with- and adapt to this SPI.

The newest version!
/*
 * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
 * All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0, which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the
 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
 * version 2 with the GNU Classpath Exception, which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 */

package jakarta.security.auth.message.config;

import jakarta.security.auth.message.ClientAuth;
import jakarta.security.auth.message.module.ClientAuthModule;

/**
 * This ClientAuthContext class encapsulates ClientAuthModules that are used to secure service requests made by a
 * client, and to validate any responses received to those requests. A caller typically uses this class in the following
 * manner:
 *
 * 
    *
  1. Retrieve an instance of this class by using ClientAuthConfig.getAuthContext. *
  2. Invoke secureRequest.
    * ClientAuthContext implementation invokes secureRequest of one or more encapsulated ClientAuthModules. Modules might * attach credentials to request (for example, a user name and password), and/or secure the request (for example, sign * and encrypt the request). *
  3. Send request and receive response. *
  4. Invoke validateResponse.
    * ClientAuthContext implementation invokes validateResponse of one or more encapsulated ClientAuthModules. Modules * verify or decrypt response as necessary. *
  5. Invoke cleanSubject method (as necessary) to clean up any authentication state in Subject. *
* *

* A ClientAuthContext instance may be used concurrently by multiple callers. * *

* Implementations of this interface are responsible for constructing and initializing the encapsulated modules. The * initialization step includes passing the relevant request and response MessagePolicy objects to the encapsulated * modules. The MessagePolicy objects are obtained by the ClientAuthConfig instance used to obtain the ClientAuthContext * object. See ClientAuthConfig.getAuthContext for more information. * *

* Implementations of this interface are instantiated by their associated configuration object such that they know which * modules to invoke, in what order, and how results returned by preceding modules are to influence subsequent module * invocations. * *

* Calls to the inherited methods of this interface delegate to the corresponding methods of the encapsulated * authentication modules. * * @see ClientAuthConfig * @see ClientAuthModule */ public interface ClientAuthContext extends ClientAuth { }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy