org.mule.extras.acegi.AcegiSecurityContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mule-module-acegi Show documentation
Show all versions of mule-module-acegi Show documentation
Mule Acegi Support exposes Acegi Authentication providers and Method interceptors to authentication
event traffic via endpoints and method level authorisation on components.
/*
* $Id: AcegiSecurityContext.java 7976 2007-08-21 14:26:13Z dirk.olmes $
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.extras.acegi;
import org.mule.umo.security.UMOAuthentication;
import org.mule.umo.security.UMOSecurityContext;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
/**
* AcegiSecurityContext
is a UMOSecurityContext wrapper used to
* interface with an Acegi SecurityContext
*/
public class AcegiSecurityContext implements UMOSecurityContext
{
private SecurityContext delegate;
private AcegiAuthenticationAdapter authentication;
public AcegiSecurityContext(SecurityContext delegate)
{
this.delegate = delegate;
SecurityContextHolder.setContext(this.delegate);
}
public void setAuthentication(UMOAuthentication authentication)
{
this.authentication = ((AcegiAuthenticationAdapter)authentication);
delegate.setAuthentication(this.authentication.getDelegate());
SecurityContextHolder.setContext(delegate);
}
public UMOAuthentication getAuthentication()
{
return this.authentication;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy