Package com.sun.enterprise.security

Examples of com.sun.enterprise.security.ClientSecurityContext


                        excep = ex;
                        Throwable target = ex.getTargetException();
                        if (target instanceof AccessException) {
                            AccessException aexcep = (AccessException)target;
                            if (aexcep.detail instanceof NO_PERMISSION) {
                                ClientSecurityContext sc = ClientSecurityContext.getCurrent();
                                if (ClientSecurityContext.hasEmtpyCredentials(sc)) {
                                    // this is due to a cancel by the user so break out
                                    break;
                                } else {
                                    //retry the invocation after clearing the Context
View Full Code Here


               
                Object containerContext = ci.getContainerContext();
                if(containerContext != null &&
                (containerContext instanceof AppContainer)) {
                   
                    ClientSecurityContext ctx = ClientSecurityContext.getCurrent();
                    Subject s = ctx.getSubject();
                    if(s == null) {
                        // pass the handler and do the login
                        LoginContextDriver.doClientLogin(AppContainer.CERTIFICATE,
                        AppContainer.getCallbackHandler());
                        s = ctx.getSubject();
                    }
                    Iterator itr = s.getPrivateCredentials().iterator();
                    while(itr.hasNext()) {
                        Object o = itr.next();
                        if(o instanceof X509CertificateCredential) {
View Full Code Here

  SOAPAuthParam param = new SOAPAuthParam(request, null);

  Subject subject = null;
  if (isAppClient) {
      ClientSecurityContext sc = ClientSecurityContext.getCurrent();
      if (sc != null) {
    subject = sc.getSubject();
      }
  } else {
      SecurityContext sc = SecurityContext.getCurrent();
      if (sc != null && !sc.didServerGenerateCredentials()) {
    // make sure we don't use default unauthenticated subject,
    // so that module cannot change this important (constant)
    // subject.
    subject = sc.getSubject();
      }
  }
  if (subject == null) subject = new Subject();
 
  cAC.secureRequest ( param, subject, sharedState);
View Full Code Here

  Subject s = null;

  if (Switch.getSwitch().getContainerType() ==
      Switch.APPCLIENT_CONTAINER) {

      ClientSecurityContext sc = ClientSecurityContext.getCurrent();
      if (sc != null) {
    s = sc.getSubject();
      }

      if (s == null) {
    s = Subject.getSubject(AccessController.getContext());
      }

  } else {
      SecurityContext sc = SecurityContext.getCurrent();
      if (sc != null && !sc.didServerGenerateCredentials()) {
    // make sure we don't use default unauthenticated subject,
    // so that module cannot change this important (constant)
    // subject.
    s = sc.getSubject();
      }
  }

  if (s == null) {
      s = new Subject();
View Full Code Here

            _logger.fine("scheme=" + scheme);
            _logger.fine("requesting prompt=" + getRequestingPrompt());
            _logger.fine("requesting protocol=" + getRequestingProtocol());
        }

  ClientSecurityContext cont = ClientSecurityContext.getCurrent();
  subject = (cont != null) ? cont.getSubject() : null;
  user = getUserName(subject);
  password = getPassword(subject);
  if(user == null || password == null) {
      try {
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.fine("Initiating login again...");
                }
               
    LoginContextDriver.doClientLogin(AppContainer.USERNAME_PASSWORD,
      AppContainer.getCallbackHandler());
    cont = ClientSecurityContext.getCurrent();
    subject = cont.getSubject();
    user = getUserName(subject);
    password = getPassword(subject);
      } catch(Exception e) {
                _logger.log(Level.FINE, "Exception " + e.toString(), e);
          return null;
View Full Code Here

     * @param Credentials the credentials that the server associated with it
     */
    private static void setClientSecurityContext(String username,
                                                 Subject subject) {
                                                
        ClientSecurityContext securityContext =
            new ClientSecurityContext(username, subject);
        ClientSecurityContext.setCurrent(securityContext);
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.ClientSecurityContext

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.