javax.security.auth.message.config

Interface AuthConfigProvider


  • public interface AuthConfigProvider
    This interface is implemented by objects that can be used to obtain authentication context configuration objects, that is, ClientAuthConfig or ServerAuthConfig objects.

    Authentication context configuration objects serve as sources of the authentication context objects, that is, ClientAuthContext or ServerAuthContext objects, for a specific message layer and messaging context.

    Authentication context objects encapsulate the initialization, configuration, and invocation of authentication modules, that is, ClientAuthModule or ServerAuthModule objects, for a specific message exchange within a specific message layer and messaging context.

    Callers do not directly operate on authentication modules. Instead, they rely on a ClientAuthContext or ServerAuthContext to manage the invocation of modules. A caller obtains an instance of ClientAuthContext or ServerAuthContext by calling the respective getAuthContext method on a ClientAuthConfig or ServerAuthConfig object obtained from an AuthConfigProvider.

    The following represents a typical sequence of calls for obtaining a client authentication context object, and then using it to secure a request.

    1. AuthConfigProvider provider;
    2. ClientAuthConfig config = provider.getClientAuthConfig(layer,appID,cbh);
    3. String authContextID = config.getAuthContextID(messageInfo);
    4. ClientAuthContext context = config.getAuthContext(authContextID,subject,properties);
    5. context.secureRequest(messageInfo,subject);

    Every implementation of this interface must offer a public, two argument constructor with the following signature:

     
     public AuthConfigProviderImpl(Map properties, AuthConfigFactory factory);
     
    
    where the properties argument may be null, and where all values and keys occurring in a non-null properties argument must be of type String. When the factory argument is not null, it indicates that the provider is to self-register at the factory by calling the following method on the factory:
     
     public String 
     registerConfigProvider(AuthConfigProvider provider, String layer, 
                            String appContext, String description);
     
     
    See Also:
    ClientAuthContext, ServerAuthContext, AuthConfigFactory
    • Method Detail

      • getClientAuthConfig

        ClientAuthConfig getClientAuthConfig(String layer,
                                             String appContext,
                                             CallbackHandler handler)
                                      throws AuthException
        Get an instance of ClientAuthConfig from this provider.

        The implementation of this method returns a ClientAuthConfig instance that describes the configuration of ClientAuthModules at a given message layer, and for use in an identified application context.

        Parameters:
        layer - A String identifying the message layer for the returned ClientAuthConfig object. This argument must not be null.
        appContext - A String that identifies the messaging context for the returned ClientAuthConfig object. This argument must not be null.
        handler - A CallbackHandler to be passed to the ClientAuthModules encapsulated by ClientAuthContext objects derived from the returned ClientAuthConfig. This argument may be null, in which case the implementation may assign a default handler to the configuration. The CallbackHandler assigned to the configuration must support the Callback objects required to be supported by the profile of this specification being followed by the messaging runtime. The CallbackHandler instance must be initialized with any application context needed to process the required callbacks on behalf of the corresponding application.
        Returns:
        A ClientAuthConfig Object that describes the configuration of ClientAuthModules at the message layer and messaging context identified by the layer and appContext arguments. This method does not return null.
        Throws:
        AuthException - If this provider does not support the assignment of a default CallbackHandler to the returned ClientAuthConfig.
        SecurityException - If the caller does not have permission to retrieve the configuration.
      • getServerAuthConfig

        ServerAuthConfig getServerAuthConfig(String layer,
                                             String appContext,
                                             CallbackHandler handler)
                                      throws AuthException
        Get an instance of ServerAuthConfig from this provider.

        The implementation of this method returns a ServerAuthConfig instance that describes the configuration of ServerAuthModules at a given message layer, and for a particular application context.

        Parameters:
        layer - A String identifying the message layer for the returned ServerAuthConfig object. This argument must not be null.
        appContext - A String that identifies the messaging context for the returned ServerAuthConfig object. This argument must not be null.
        handler - A CallbackHandler to be passed to the ServerAuthModules encapsulated by ServerAuthContext objects derived from the returned ServerAuthConfig. This argument may be null, in which case the implementation may assign a default handler to the configuration. The CallbackHandler assigned to the configuration must support the Callback objects required to be supported by the profile of this specification being followed by the messaging runtime. The CallbackHandler instance must be initialized with any application context needed to process the required callbacks on behalf of the corresponding application.
        Returns:
        A ServerAuthConfig Object that describes the configuration of ServerAuthModules at a given message layer, and for a particular application context. This method does not return null.
        Throws:
        AuthException - If this provider does not support the assignment of a default CallbackHandler to the returned ServerAuthConfig.
        SecurityException - If the caller does not have permission to retrieve the configuration.
      • refresh

        void refresh()
        Causes a dynamic configuration provider to update its internal state such that any resulting change to its state is reflected in the corresponding authentication context configuration objects previously created by the provider within the current process context.
        Throws:
        SecurityException - If the caller does not have permission to refresh the provider, or if an error occurred during the refresh.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

21/08/2025 15:08:18 Cette version de la page est en cache (à la date du 21/08/2025 15:08:18) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/security/auth/message/config/AuthConfigProvider.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, AuthConfigProvider (Java(TM) EE 7 Specification APIs)

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.