Examples of UsernameCredential


Examples of org.josso.auth.scheme.UsernameCredential

      //Get the User corresponding to this credentialKey
      BaseUser user = this.loadUser((SimpleUserKey)credentialKey);
      SSONameValuePair[] properties = user.getProperties();
      String password = properties[0].getValue();
     
      return new Credential[]{new UsernameCredential(user.getName()), new PasswordCredential(password)};
   }
View Full Code Here

Examples of org.uberfire.security.impl.auth.UserNameCredential

                    return null;
                }
            };
        }

        final UserNameCredential realCredential = UserNameCredential.class.cast( credential );

        if ( !authenticationSource.authenticate( realCredential, securityContext ) ) {
            return new AuthenticationResult() {
                @Override
                public List<String> getMessages() {
                    return new ArrayList<String>( 1 ) {{
                        add( "Invalid credentials." );
                    }};
                }

                @Override
                public AuthenticationStatus getStatus() {
                    return AuthenticationStatus.FAILED;
                }

                @Override
                public Principal getPrincipal() {
                    return null;
                }
            };
        }

        return new AuthenticationResult() {
            @Override
            public List<String> getMessages() {
                return emptyList();
            }

            @Override
            public AuthenticationStatus getStatus() {
                return AuthenticationStatus.SUCCESS;
            }

            @Override
            public Principal getPrincipal() {
                return new PrincipalImpl( realCredential.getUserName() );
            }
        };
    }
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.