1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.module.acegi; |
8 | |
|
9 | |
import org.mule.api.security.Authentication; |
10 | |
import org.mule.api.security.SecurityContext; |
11 | |
|
12 | |
import org.acegisecurity.context.SecurityContextHolder; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
public class AcegiSecurityContext implements SecurityContext |
20 | |
{ |
21 | |
private org.acegisecurity.context.SecurityContext delegate; |
22 | |
private AcegiAuthenticationAdapter authentication; |
23 | |
|
24 | |
public AcegiSecurityContext(org.acegisecurity.context.SecurityContext delegate) |
25 | 0 | { |
26 | 0 | this.delegate = delegate; |
27 | 0 | SecurityContextHolder.setContext(this.delegate); |
28 | 0 | } |
29 | |
|
30 | |
public void setAuthentication(Authentication authentication) |
31 | |
{ |
32 | 0 | this.authentication = ((AcegiAuthenticationAdapter)authentication); |
33 | 0 | delegate.setAuthentication(this.authentication.getDelegate()); |
34 | 0 | SecurityContextHolder.setContext(delegate); |
35 | 0 | } |
36 | |
|
37 | |
public Authentication getAuthentication() |
38 | |
{ |
39 | 0 | return this.authentication; |
40 | |
} |
41 | |
} |