Java Code Examples for org.apache.catalina.Container#getRealm()

The following examples show how to use org.apache.catalina.Container#getRealm() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AuthenticatorBase.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Attempts reauthentication to the <code>Realm</code> using the credentials
 * included in argument <code>entry</code>.
 *
 * @param ssoId
 *            identifier of SingleSignOn session with which the caller is
 *            associated
 * @param request
 *            the request that needs to be authenticated
 * @return <code>true</code> if the reauthentication from SSL occurred
 */
protected boolean reauthenticateFromSSO(String ssoId, Request request) {

    if (sso == null || ssoId == null) {
        return false;
    }

    boolean reauthenticated = false;

    Container parent = getContainer();
    if (parent != null) {
        Realm realm = parent.getRealm();
        if (realm != null) {
            reauthenticated = sso.reauthenticate(ssoId, realm, request);
        }
    }

    if (reauthenticated) {
        associate(ssoId, request.getSessionInternal(true));

        if (log.isDebugEnabled()) {
            log.debug(" Reauthenticated cached principal '" +
                    request.getUserPrincipal().getName() +
                    "' with auth type '" + request.getAuthType() + "'");
        }
    }

    return reauthenticated;
}
 
Example 2
Source File: AuthenticatorBase.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Attempts reauthentication to the <code>Realm</code> using
 * the credentials included in argument <code>entry</code>.
 *
 * @param ssoId identifier of SingleSignOn session with which the
 *              caller is associated
 * @param request   the request that needs to be authenticated
 */
protected boolean reauthenticateFromSSO(String ssoId, Request request) {

    if (sso == null || ssoId == null)
        return false;

    boolean reauthenticated = false;

    Container parent = getContainer();
    if (parent != null) {
        Realm realm = parent.getRealm();
        if (realm != null) {
            reauthenticated = sso.reauthenticate(ssoId, realm, request);
        }
    }

    if (reauthenticated) {
        associate(ssoId, request.getSessionInternal(true));

        if (log.isDebugEnabled()) {
            log.debug(" Reauthenticated cached principal '" +
                      request.getUserPrincipal().getName() +
                      "' with auth type '" +  request.getAuthType() + "'");
        }
    }

    return reauthenticated;
}
 
Example 3
Source File: AuthenticatorBase.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Attempts reauthentication to the <code>Realm</code> using
 * the credentials included in argument <code>entry</code>.
 *
 * @param ssoId identifier of SingleSignOn session with which the
 *              caller is associated
 * @param request   the request that needs to be authenticated
 */
protected boolean reauthenticateFromSSO(String ssoId, Request request) {

    if (sso == null || ssoId == null)
        return false;

    boolean reauthenticated = false;

    Container parent = getContainer();
    if (parent != null) {
        Realm realm = parent.getRealm();
        if (realm != null) {
            reauthenticated = sso.reauthenticate(ssoId, realm, request);
        }
    }

    if (reauthenticated) {
        associate(ssoId, request.getSessionInternal(true));

        if (log.isDebugEnabled()) {
            log.debug(" Reauthenticated cached principal '" +
                      request.getUserPrincipal().getName() +
                      "' with auth type '" +  request.getAuthType() + "'");
        }
    }

    return reauthenticated;
}