1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.security; |
8 | |
|
9 | |
import org.mule.api.security.Authentication; |
10 | |
import org.mule.api.security.Credentials; |
11 | |
|
12 | |
import java.util.Map; |
13 | |
|
14 | |
public class DefaultMuleAuthentication implements Authentication |
15 | |
{ |
16 | |
private boolean authenticated; |
17 | |
private char[] credentials; |
18 | |
private String user; |
19 | |
private Map properties; |
20 | |
|
21 | |
public DefaultMuleAuthentication(Credentials credentials) |
22 | 0 | { |
23 | 0 | this.user = credentials.getUsername(); |
24 | 0 | this.credentials = credentials.getPassword(); |
25 | 0 | } |
26 | |
|
27 | |
public void setAuthenticated(boolean b) |
28 | |
{ |
29 | 0 | authenticated = b; |
30 | 0 | } |
31 | |
|
32 | |
public boolean isAuthenticated() |
33 | |
{ |
34 | 0 | return authenticated; |
35 | |
} |
36 | |
|
37 | |
public Object getCredentials() |
38 | |
{ |
39 | 0 | return new String(credentials); |
40 | |
} |
41 | |
|
42 | |
public Object getPrincipal() |
43 | |
{ |
44 | 0 | return user; |
45 | |
} |
46 | |
|
47 | |
public Map getProperties() |
48 | |
{ |
49 | 0 | return properties; |
50 | |
} |
51 | |
|
52 | |
public void setProperties(Map properties) |
53 | |
{ |
54 | 0 | this.properties = properties; |
55 | 0 | } |
56 | |
|
57 | |
} |