Package org.opensaml

Examples of org.opensaml.SAMLNameIdentifier


      try
      {
         String request = null;
        
         //create a SAMLSubject
         SAMLNameIdentifier id = new SAMLNameIdentifier();
         id.setName(username);
         id.setNameQualifier(password);
         id.setFormat(SAMLNameIdentifier.FORMAT_UNSPECIFIED);
         SAMLSubject subject = new SAMLSubject();
         subject.setNameIdentifier(id);     
         SAMLAuthenticationQuery query = new SAMLAuthenticationQuery(subject,
               SAMLAuthenticationStatement.AuthenticationMethod_Password);
        
View Full Code Here


         authResponse.setId(this.idProvider.getIdentifier());
        
         if(success)
         {
            //create a successfull authenticationstatment
            SAMLNameIdentifier id = new SAMLNameIdentifier();
            id.setName(username);
            id.setFormat(SAMLNameIdentifier.FORMAT_UNSPECIFIED);
            SAMLSubject subject = new SAMLSubject();
            subject.setNameIdentifier(id);
           
            String methodStr = SAMLAuthenticationStatement.AuthenticationMethod_Password;
            SAMLAuthenticationStatement authStatement = new SAMLAuthenticationStatement();
View Full Code Here

        
         SAMLAuthenticationQuery query = (SAMLAuthenticationQuery)authRequest.getQuery();
         SAMLSubject subject = query.getSubject();
        
         //get the SAMLNameIdentifier
         SAMLNameIdentifier id = subject.getNameIdentifier();
         String username = id.getName();
         String password = id.getNameQualifier();
        
         user = new SSOUser(username,password);
        
         return user;
      }
View Full Code Here

            Date expirationTime, RahasData data) throws TrustException {
        try {
            Principal principal = data.getPrincipal();
            // In the case where the principal is a UT
            if (principal instanceof WSUsernameTokenPrincipal) {
              SAMLNameIdentifier nameId = null;
              if(config.getCallbackHander() != null){
                SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
                cb.setUserId(principal.getName());
                SAMLCallbackHandler callbackHandler = config.getCallbackHander();
                callbackHandler.handle(cb);
                nameId = cb.getNameId();
              }else{
                  nameId = new SAMLNameIdentifier(
                principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
              }
             
                return createAuthAssertion(doc, SAMLSubject.CONF_BEARER,
                        nameId, null, config, crypto, creationTime,
View Full Code Here

                    crypto, creationTime, expirationTime);
        } else {
            try {
                String subjectNameId = data.getPrincipal().getName();
               
                SAMLNameIdentifier nameId = new SAMLNameIdentifier(
                        subjectNameId, null, SAMLNameIdentifier.FORMAT_EMAIL);

                // Create the ds:KeyValue element with the ds:X509Data
                X509Certificate clientCert = data.getClientCert();
View Full Code Here

            Date expirationTime, RahasData data) throws TrustException {
        try {
            Principal principal = data.getPrincipal();
            // In the case where the principal is a UT
            if (principal instanceof WSUsernameTokenPrincipal) {
              SAMLNameIdentifier nameId = null;
              if(config.getCallbackHander() != null){
                SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
                cb.setUserId(principal.getName());
                SAMLCallbackHandler callbackHandler = config.getCallbackHander();
                callbackHandler.handle(cb);
                nameId = cb.getNameId();
              }else{
                  nameId = new SAMLNameIdentifier(
                principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
              }
             
                return createAuthAssertion(doc, SAMLSubject.CONF_BEARER,
                        nameId, null, config, crypto, creationTime,
View Full Code Here

                    crypto, creationTime, expirationTime);
        } else {
            try {
                String subjectNameId = data.getPrincipal().getName();
               
                SAMLNameIdentifier nameId = new SAMLNameIdentifier(
                        subjectNameId, null, SAMLNameIdentifier.FORMAT_EMAIL);

                // Create the ds:KeyValue element with the ds:X509Data
                X509Certificate clientCert = data.getClientCert();
View Full Code Here

        try {
            Principal principal = data.getPrincipal();
            SAMLAssertion assertion;
            // In the case where the principal is a UT
            if (principal instanceof WSUsernameTokenPrincipal) {
              SAMLNameIdentifier nameId = null;
              if(config.getCallbackHandler() != null){
                SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
                cb.setUserId(principal.getName());
                SAMLCallbackHandler callbackHandler = config.getCallbackHandler();
                callbackHandler.handle(cb);
                nameId = cb.getNameId();
              }else{
                  nameId = new SAMLNameIdentifier(
                principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
              }
              assertion = createAuthAssertion(doc, SAMLSubject.CONF_BEARER,
                        nameId, null, config, crypto, creationTime,
                        expirationTime, data);
View Full Code Here

                    crypto, creationTime, expirationTime);
        } else {
            try {
                String subjectNameId = data.getPrincipal().getName();
               
                SAMLNameIdentifier nameId = new SAMLNameIdentifier(
                        subjectNameId, null, SAMLNameIdentifier.FORMAT_EMAIL);

                // Create the ds:KeyValue element with the ds:X509Data
                X509Certificate clientCert = data.getClientCert();
View Full Code Here

        String name =
                properties.getProperty("org.apache.ws.security.saml.subjectNameId.name");
        String qualifier =
                properties.getProperty("org.apache.ws.security.saml.subjectNameId.qualifier");
        try {
            SAMLNameIdentifier nameId =
                    new SAMLNameIdentifier(name, qualifier, "");
            String subjectIP = null;
            String authMethod = null;
            if ("password"
                    .equals(properties.getProperty("org.apache.ws.security.saml.authenticationMethod"))) {
                authMethod =
View Full Code Here

TOP

Related Classes of org.opensaml.SAMLNameIdentifier

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.