// Path: core/src/main/java/org/pac4j/jax/rs/helpers/RequestPac4JSecurityContext.java
// public class RequestPac4JSecurityContext {
// 
//     private final SecurityContext securityContext;
// 
//     public RequestPac4JSecurityContext(JaxRsContext context) {
//         this(context.getRequestContext());
//     }
// 
//     public RequestPac4JSecurityContext(ContainerRequestContext request) {
//         this(request.getSecurityContext());
//     }
// 
//     public RequestPac4JSecurityContext(SecurityContext securityContext) {
//         this.securityContext = securityContext;
//     }
// 
//     public Optional<Pac4JSecurityContext> context() {
//         if (securityContext instanceof Pac4JSecurityContext) {
//             return Optional.of((Pac4JSecurityContext) securityContext);
//         } else {
//             return Optional.empty();
//         }
//     }
// }


import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;
import javax.ws.rs.core.SecurityContext;
import org.pac4j.core.profile.*;
import org.pac4j.jax.rs.helpers.RequestPac4JSecurityContext;
package org.pac4j.jax.rs.pac4j;




/**
 *
 * @author Victor Noel - Linagora
 * @since 1.0.0
 *
 */
public class JaxRsProfileManager extends ProfileManager<CommonProfile> {

    public JaxRsProfileManager(JaxRsContext context) {
        super(context);
    }

    @Override
    public void logout() {
        super.logout();

// Path: core/src/main/java/org/pac4j/jax/rs/helpers/RequestPac4JSecurityContext.java
// public class RequestPac4JSecurityContext {
// 
//     private final SecurityContext securityContext;
// 
//     public RequestPac4JSecurityContext(JaxRsContext context) {
//         this(context.getRequestContext());
//     }
// 
//     public RequestPac4JSecurityContext(ContainerRequestContext request) {
//         this(request.getSecurityContext());
//     }
// 
//     public RequestPac4JSecurityContext(SecurityContext securityContext) {
//         this.securityContext = securityContext;
//     }
// 
//     public Optional<Pac4JSecurityContext> context() {
//         if (securityContext instanceof Pac4JSecurityContext) {
//             return Optional.of((Pac4JSecurityContext) securityContext);
//         } else {
//             return Optional.empty();
//         }
//     }
// }


// Path: core/src/main/java/org/pac4j/jax/rs/pac4j/JaxRsProfileManager.java
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;
import javax.ws.rs.core.SecurityContext;
import org.pac4j.core.profile.*;
import org.pac4j.jax.rs.helpers.RequestPac4JSecurityContext;

package org.pac4j.jax.rs.pac4j;




/**
 *
 * @author Victor Noel - Linagora
 * @since 1.0.0
 *
 */
public class JaxRsProfileManager extends ProfileManager<CommonProfile> {

    public JaxRsProfileManager(JaxRsContext context) {
        super(context);
    }

    @Override
    public void logout() {
        super.logout();

        new RequestPac4JSecurityContext((JaxRsContext) this.context).context().ifPresent(c -> c.principal = null);