@Override
    public String getRemotePrincipalId(final HttpServletRequest request) {
        val principal = request.getUserPrincipal();

        if (principal != null) {
            LOGGER.debug("Principal [{}] found in HttpServletRequest", principal.getName());
            return principal.getName();
        }
        return null;
    }
Implementation of the {@link AbstractNonInteractiveCredentialsAction} that looks for a user
principal that is set in the {@link HttpServletRequest} and attempts
to construct a Principal (and thus a {@link PrincipalBearingCredential}). If it
doesn't find one, this class returns and error event which tells the web flow
it could not find any credentials.

@author Scott Battaglia
@since 3.0.5
support/cas-server-support-trusted/src/main/java/org/apereo/cas/adaptors/trusted/web/flow/PrincipalFromRequestUserPrincipalNonInteractiveCredentialsAction.java