felles/sikkerhet/src/main/java/no/nav/vedtak/sikkerhet/jaspic/SamAutoRegistration.java
/**
     * Registers a server auth module as the one and only module for the application
     * corresponding to the given servlet context.
     *
     * This will override any other modules that have already been registered,
     * either via proprietary means or using the standard API.
     *
     * @param serverAuthModule the server auth module to be registered
     * @param servletContext   the context of the app for which the module is
     *                         registered
     * @return A String identifier assigned by an underlying factory corresponding
     *         to an underlying factory-factory-factory registration
     */
Registers a server auth module as the one and only module for the application
corresponding to the given servlet context.

This will override any other modules that have already been registered,
either via proprietary means or using the standard API.

@param serverAuthModule the server auth module to be registered
@param servletContext   the context of the app for which the module is
registered
@return A String identifier assigned by an underlying factory corresponding
to an underlying factory-factory-factory registration
Registers a server auth module as the one and only module for the application corresponding to the given servlet context . This will override any other modules that have already been registered either via proprietary means or using the standard API . @param serverAuthModule the server auth module to be registered @param servletContext the context of the app for which the module is registered @return A String identifier assigned by an underlying factory corresponding to an underlying factory - factory - factory registration
public static String registerServerAuthModule(ServerAuthModule serverAuthModule, ServletContext servletContext) {
        String registrationId = AuthConfigFactory.getFactory().registerConfigProvider(
                new OidcAuthConfigProvider(serverAuthModule),
                "HttpServlet",
                getAppContextID(servletContext),
                "Default single SAM authentication config provider");
        servletContext.setAttribute(CONTEXT_REGISTRATION_ID, registrationId);
        return registrationId;
    }
public static String registerServerAuthModule ( ServerAuthModule serverAuthModule , ServletContext servletContext ) { String registrationId = AuthConfigFactory . getFactory ( ) . registerConfigProvider ( new OidcAuthConfigProvider ( serverAuthModule ) , "HttpServlet" , getAppContextID ( servletContext ) , "Default single SAM authentication config provider" ) ; servletContext . setAttribute ( CONTEXT_REGISTRATION_ID , registrationId ) ; return registrationId ; }
Registers a server auth module as the one and only module for the application
 corresponding to the given servlet context.
Registers a server auth module as the one and only module for the application corresponding to the given servlet context .
// Register the factory-factory-factory for the SAM // Remember the registration ID returned by the factory, so we can unregister // the JASPIC module when the web module // is undeployed. JASPIC being the low level API that it is won't do this // automatically.