Examples of Subject


Examples of javax.security.auth.Subject

   }

   protected void invokeOnDelegate(final Method m, final Object[] args, final Object delegate)
      throws Exception
   {   // Get authenticated subject and invoke invokeAsSubject in Subject.doAsPrivaledged() block...
      final Subject subject = subjectSecurityManager.getActiveSubject();
      if (subject == null)
         throw new SecurityException("No subject associated with secure proxy");

      try
      {
View Full Code Here

Examples of javax.security.auth.Subject

      //it is an explicit spec requirement that equals be used for matching rather than ==.
      if (!poolingStrategy.getManagedConnectionFactory().equals(mcf))
         throw new ResourceException("Wrong ManagedConnectionFactory sent to allocateConnection!");

      // Pick a managed connection from the pool
      Subject subject = getSubject();
      ConnectionListener cl = getManagedConnection(subject, cri);

      // Tell each connection manager the managed connection is active
      reconnectManagedConnection(cl);
View Full Code Here

Examples of javax.security.auth.Subject

      cl.registerConnection(c);
   }

   private Subject getSubject()
   {
      Subject subject = null;
      if(subjectFactory != null && securityDomainJndiName != null)
      {
         subject = subjectFactory.createSubject(securityDomainJndiName);
      }
      if (trace)
View Full Code Here

Examples of javax.security.auth.Subject

        CallbackHandler handler = new UsernamePasswordHandler("scott", "stark".toCharArray());
        try
        {
            LoginContext lc = new LoginContext("srp-login", handler);
            lc.login();
            Subject subject = lc.getSubject();
            System.out.println("Subject="+subject);
        }
        catch(LoginException e)
        {
            e.printStackTrace();
View Full Code Here

Examples of javax.security.auth.Subject

      ArrayList alist = new ArrayList();
     
      String SUBJECT_CONTEXT_KEY = "javax.security.auth.Subject.container";
      try
      {
         Subject caller = (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
         Iterator iter = caller.getPrincipals().iterator();
         while(iter != null && iter.hasNext())
         {
            Principal p = (Principal)iter.next();
            if(p instanceof SimpleGroup)
            {
View Full Code Here

Examples of javax.security.auth.Subject

    */
   public Object invoke(Invocation invocation) throws Throwable
   {
    SecurityContext previousSC = null;
      String type = invocation.getType();
      Subject subject = null;
      if (!initialized)
         initialize();
      if (type == Invocation.OP_INVOKE && securityMgr != null)
      {
         String opName = invocation.getName();
         if (opName.equals("invoke"))
         {
            Object[] args = invocation.getArgs();
            org.jboss.invocation.Invocation inv = (org.jboss.invocation.Invocation) args[0];
            // Authenticate the caller based on the security association
            Principal caller = inv.getPrincipal();
            Object credential = inv.getCredential();
            subject = new Subject();
            boolean isValid = securityMgr.isValid(caller, credential, subject);
            if (isValid == false)
            {
               String msg = "Failed to authenticate principal=" + caller + ", securityDomain="
                     + securityMgr.getSecurityDomain();
View Full Code Here

Examples of jug.domain.Subject

        container.close();
    }

    @Test
    public void persistSimpleSubject() {
        final Subject subject = subjectDao.create("TOMEE_JUG", "What do you think about this JUG?");
        assertNotNull(subject);
        assertEquals("TOMEE_JUG", subject.getName());
    }
View Full Code Here

Examples of net.sf.esims.model.entity.Subject

  /**
   *
   * @return valid instance of subject , NO ID is assigned
   */
  public static Subject createValidSubject(){
    return new Subject("Maths",createValidStandard(),new Boolean(true),"teach everything");
  }
View Full Code Here

Examples of org.apache.avro.repo.Subject

       client = new RESTRepositoryClient(props.getProperty(ETL_SCHEMA_REGISTRY_URL));
  }

  @Override
  public String register(String topic, Schema schema) {
    Subject subject = client.lookup(topic);

    if (subject == null) {
      subject = client.register(topic, "org.apache.avro.repo.Validator");
    }

    try {
      return subject.register(schema.toString()).getId();
    } catch (SchemaValidationException e) {
      throw new SchemaRegistryException(e);
    }
  }
View Full Code Here

Examples of org.apache.cxf.rs.security.saml.assertion.Subject

       
    }
   
    public static Subject getSubject(Message message, AssertionWrapper assertionW) {
        org.opensaml.saml2.core.Subject s = assertionW.getSaml2().getSubject();
        Subject subject = new Subject();
        NameID nameId = s.getNameID();
        subject.setNameQualifier(nameId.getNameQualifier());
        // if format is transient then we may need to use STSClient
        // to request an alternate name from IDP
        subject.setNameFormat(nameId.getFormat());
       
        subject.setName(nameId.getValue());
        subject.setSpId(nameId.getSPProvidedID());
        subject.setSpQualifier(nameId.getSPNameQualifier());
        return subject;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.