Package org.jvnet.glassfish.comms.security.auth.impl

Examples of org.jvnet.glassfish.comms.security.auth.impl.PAssertedAuthenticator


        }
    }

    private void handlePAssertedAuthentication(SipServletRequest request) throws IOException {
        PAssertedAuthenticatorFactory paf = PAssertedAuthenticatorFactory.getInstance();
        PAssertedAuthenticator auth = null;
        if (trustConfigId == null || trustConfigId.length() == 0) {
            auth = (PAssertedAuthenticator) paf.getAuthenticator();
        } else {
            auth = (PAssertedAuthenticator) paf.getAuthenticator(trustConfigId);
        }
        if (auth == null) {
            throw new SecurityException("P-Asserted Authenticator not configured");
        }

        TargetTuple remoteHost = ((SipServletRequestImpl) request).getInitialRemote();
        String host = "";
        if (remoteHost != null) {
            host = remoteHost.getIP();
        }
        Principal authPrincipal = auth.authenticate(request, host,
                identityAuthRealm, auth.INTERMEDIATE);
        if (authPrincipal != null) {
            ((SipServletRequestImpl) request).setUserPrincipal(authPrincipal);
            ((SipServletRequestImpl) request).setUser(authPrincipal.getName());
        } else {
View Full Code Here


    public void handleAssertedIdentity() {
        ListIterator<String> passertedHeader = this.getHeaders(P_ASSERTED_ID);
        ListIterator<String> ppreferredHeader = this.getHeaders(P_PREFERRED_ID);

        if (passertedHeader.hasNext() || ppreferredHeader.hasNext()) {
            PAssertedAuthenticator auth = (PAssertedAuthenticator) PAssertedAuthenticatorFactory.getInstance()
                                                                                                .getAuthenticator();

            if (auth != null) {
                TargetTuple remoteHost = ((SipServletRequestImpl) this).getRemote();
                String host = "";

                if (remoteHost != null) {
                    host = remoteHost.getIP();
                }

                auth.verifyMessage(this, host);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jvnet.glassfish.comms.security.auth.impl.PAssertedAuthenticator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.