1 | |
package ca.uhn.hl7v2.hoh.auth; |
2 | |
|
3 | |
import ca.uhn.hl7v2.hoh.api.IAuthorizationServerCallback; |
4 | |
import ca.uhn.hl7v2.hoh.util.StringUtils; |
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
public class SingleCredentialServerCallback implements IAuthorizationServerCallback { |
10 | |
|
11 | |
private String myUsername; |
12 | |
private String myPassword; |
13 | |
|
14 | 100 | public SingleCredentialServerCallback(String theUsername, String thePassword) { |
15 | 100 | myUsername = theUsername; |
16 | 100 | myPassword = thePassword; |
17 | 100 | } |
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
public boolean authorize(String theUriPath, String theUsername, String thePassword) { |
23 | 125 | return StringUtils.equals(myUsername, theUsername) && StringUtils.equals(myPassword, thePassword); |
24 | |
} |
25 | |
|
26 | |
} |