Examples of AuthenticationService


Examples of org.apache.derby.iapi.jdbc.AuthenticationService

    /**
     * @throws SQLException if authentication or privileges check fails
     */
    public void checkShutdownPrivileges() throws SQLException {   
        // get the system's authentication service
        final AuthenticationService auth
            = ((AuthenticationService)
               Monitor.findService(AuthenticationService.MODULE,
                                   "authentication"));

        // authenticate user
        if (auth != null) {
            final Properties finfo = new Properties();
            if (userArg != null) {
                finfo.setProperty("user", userArg);
            }
            if (passwordArg != null) {
                finfo.setProperty("password", passwordArg);
            }
            if (!auth.authenticate((String)null, finfo)) {
                // not a valid user
                throw Util.generateCsSQLException(
                SQLState.NET_CONNECT_AUTH_FAILED,
                MessageService.getTextMessage(MessageId.AUTH_INVALID));
            }
View Full Code Here

Examples of org.apache.derby.iapi.jdbc.AuthenticationService

                              LanguageConnectionContext lcc,
                              DataDictionary dd,
                              TransactionController tc)
            throws StandardException {
        //
        AuthenticationService s = lcc.getDatabase().getAuthenticationService();

        if (currentUser.equals(roleName)) {
            return true;
        }
View Full Code Here

Examples of org.apache.derby.iapi.jdbc.AuthenticationService

    // otherwise check if it is a valid user in the JBMS system.
    //
    // NOTE: We always expect an authentication service per database
    // and one at the system level.
    //
    AuthenticationService authenticationService = null;

        try {
            // Retrieve appropriate authentication service handle
            if (dbname == null)
                authenticationService =
                    getLocalDriver().getAuthenticationService();
            else
                authenticationService =
                    getTR().getDatabase().getAuthenticationService();

        } catch (StandardException se) {
            throw Util.generateCsSQLException(se);
        }

    // check that we do have a authentication service
    // it is _always_ expected.
    if (authenticationService == null)
    {
      String failedString = MessageService.getTextMessage(
        (dbname == null) ? MessageId.AUTH_NO_SERVICE_FOR_SYSTEM : MessageId.AUTH_NO_SERVICE_FOR_DB);

      throw newSQLException(SQLState.LOGIN_FAILED, failedString);
    }

    if (dbname != null) {
      checkUserIsNotARole();
    }

    // Let's authenticate now
     
    if (!authenticationService.authenticate(
                         dbname,
                         userInfo
                         )) {

      throw newSQLException(SQLState.NET_CONNECT_AUTH_FAILED,
View Full Code Here

Examples of org.apache.derby.iapi.jdbc.AuthenticationService

    /**
     * @throws SQLException if authentication or privileges check fails
     */
    public void checkShutdownPrivileges() throws SQLException {   
        // get the system's authentication service
        final AuthenticationService auth
            = ((AuthenticationService)
               Monitor.findService(AuthenticationService.MODULE,
                                   "authentication"));

        // authenticate user
        if (auth != null) {
            final Properties finfo = new Properties();
            if (userArg != null) {
                finfo.setProperty("user", userArg);
            }
            if (passwordArg != null) {
                finfo.setProperty("password", passwordArg);
            }
            if (!auth.authenticate((String)null, finfo)) {
                // not a valid user
                throw Util.generateCsSQLException(
                SQLState.NET_CONNECT_AUTH_FAILED,
                MessageService.getTextMessage(MessageId.AUTH_INVALID));
            }
View Full Code Here

Examples of org.apache.ldap.server.authn.AuthenticationService

    {
        InterceptorChain chain = new InterceptorChain();

        chain.addFirst( "normalizationService", new NormalizationService() );

        chain.addBefore( NEXT_INTERCEPTOR, "authenticationService", new AuthenticationService() );

        chain.addBefore( NEXT_INTERCEPTOR, "authorizationService", new AuthorizationService() );

        chain.addBefore( NEXT_INTERCEPTOR, "exceptionService", new ExceptionService() );
View Full Code Here

Examples of org.glassfish.security.services.api.authentication.AuthenticationService

    @SecurityScope
    public AuthenticationService provide() {
        String currentState = manager.getCurrent();

        // Get Service Instance
        AuthenticationService atnService = AccessController.doPrivileged(
                new PrivilegedLookup<AuthenticationService>(
                        serviceLocator, AuthenticationService.class));

        // Get Service Configuration
        org.glassfish.security.services.config.AuthenticationService atnConfiguration =
            serviceLocator.getService(org.glassfish.security.services.config.AuthenticationService.class,currentState);

        // Initialize Service
        atnService.initialize(atnConfiguration);

        return atnService;
    }
View Full Code Here

Examples of org.glassfish.security.services.config.AuthenticationService

   */
  private class AuthenticationConfigHandler extends ServiceConfigHandler<AuthenticationService> {
    @Override
    public AuthenticationService setupConfiguration(ActionReport report, SecurityConfiguration securityServiceConfig) {
        // TODO - Additional type checking needed?
        AuthenticationService config = (AuthenticationService) securityServiceConfig;
        try {
            config = (AuthenticationService) ConfigSupport.apply(new SingleConfigCode<AuthenticationService>() {
                @Override
                public Object run(AuthenticationService param) throws PropertyVetoException, TransactionFailure {
                  // Look at the use password credential setting
View Full Code Here

Examples of org.jboss.portal.identity.sso.AuthenticationService

        
         String username = credentials.getUsername();
         String password = credentials.getPassword();        
        
         MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
         AuthenticationService authService = (AuthenticationService)
         MBeanProxy.get(AuthenticationService.class,new ObjectName("portal:service=Module,type=CASAuthenticationService"),mbeanServer);
             
         //Perform this operation in the context of a UserTransaction        
         status = authService.authenticate(username, password);
        
         return status;
      }
      catch(Exception e)
      {
View Full Code Here

Examples of org.jbpm.security.AuthenticationService

  /**
   * sets the currently authenticated actorId.
   */
  public void setActorId(String actorId)
  {
    AuthenticationService authenticationService = services.getAuthenticationService();
    authenticationService.setActorId(actorId);
  }
View Full Code Here

Examples of org.jbpm.security.AuthenticationService

    }
  }
 
  public void testAuthenticationService() {
    Map serviceFactories = new HashMap();
    AuthenticationService authenticationService = new DefaultAuthenticationService();
    serviceFactories.put("authentication", new TestGivenServiceFactory(
            authenticationService
          ));
    Services services = new Services(serviceFactories);
    assertSame(authenticationService, services.getAuthenticationService());
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.