class SecurityContextImpl implements SecurityContext {

    public String getAuthenticationScheme() {
        if (m.get(AuthorizationPolicy.class) != null) {
            return SecurityContext.BASIC_AUTH;
        }
        @SuppressWarnings("unchecked")
        Map<String, List<String>> headers =
            (Map<String, List<String>>)m.get(Message.PROTOCOL_HEADERS);
        if (headers != null) {
            List<String> values = headers.get(HttpHeaders.AUTHORIZATION);
            if (values != null && values.size() == 1) {
                String value = values.get(0);
                if (value != null) {
                    int index = value.trim().indexOf(' ');
                    if (index != -1) {
                        return value.substring(0, index);
                    }
                }
            }
        }
        return null;
    }

    public  SecurityContextImpl(Message m);

}