@Override
public SecurityContext create(String userName, String credential, boolean isSecure, String authcScheme, String host) {
AuthenticationToken authToken;
if (credential == null) {
authToken = new UsernamePasswordToken(userName, credential, host);
} else {
if (credential.equalsIgnoreCase("session")) {
authToken = new SessionIdToken(userName, host);
} else if (credential.equalsIgnoreCase("token")) {
authToken = new AccessTokenAuthToken(userName, host);
} else {
authToken = new UsernamePasswordToken(userName, credential, host);
}
}
return new ShiroSecurityContext(
new Subject.Builder(sm).host(host).sessionCreationEnabled(false).buildSubject(),