Examples of Credentials


Examples of org.apache.directory.ldapstudio.browser.core.internal.model.Credentials

    public ICredentials getCredentials( final ConnectionParameter connectionParameter )
    {

        if ( connectionParameter.getBindPrincipal() == null || "".equals( connectionParameter.getBindPrincipal() ) )
        {
            return new Credentials( "", "", connectionParameter );
        }
        else if ( connectionParameter.getBindPassword() != null && !"".equals( connectionParameter.getBindPassword() ) )
        {
            return new Credentials( connectionParameter.getBindPrincipal(), connectionParameter.getBindPassword(),
                connectionParameter );
        }
        else
        {
            final String[] pw = new String[1];
            PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
            {
                public void run()
                {
                    CredentialsDialog dialog = new CredentialsDialog( PlatformUI.getWorkbench().getDisplay()
                        .getActiveShell(), "Enter Password for '" + connectionParameter.getName() + "'",
                        "Please enter password of user " + connectionParameter.getBindPrincipal() + ":", "", null );
                    if ( dialog.open() == CredentialsDialog.OK )
                    {
                        pw[0] = dialog.getValue();
                    }
                    else
                    {
                        pw[0] = null;
                    }
                }
            } );

            if ( pw[0] == null )
            {
                return null;
            }
            else
            {
                return new Credentials( connectionParameter.getBindPrincipal(), pw[0], connectionParameter );
            }
        }

    }
View Full Code Here

Examples of org.apache.directory.studio.connection.core.Credentials

    public ICredentials getCredentials( final ConnectionParameter connectionParameter )
    {

        if ( connectionParameter.getBindPrincipal() == null || "".equals( connectionParameter.getBindPrincipal() ) ) //$NON-NLS-1$
        {
            return new Credentials( "", "", connectionParameter ); //$NON-NLS-1$ //$NON-NLS-2$
        }
        else if ( connectionParameter.getBindPassword() != null && !"".equals( connectionParameter.getBindPassword() ) ) //$NON-NLS-1$
        {
            return new Credentials( connectionParameter.getBindPrincipal(), connectionParameter.getBindPassword(),
                connectionParameter );
        }
        else
        {
            final String[] pw = new String[1];
            PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
            {
                public void run()
                {
                    CredentialsDialog dialog = new CredentialsDialog(
                        PlatformUI.getWorkbench().getDisplay().getActiveShell(),
                        NLS
                            .bind(
                                Messages.getString( "UIAuthHandler.EnterPasswordFor" ), new String[] { connectionParameter.getName() } ), //$NON-NLS-1$
                        Messages.getString( "UIAuthHandler.PleaseEnterPasswordOfUser" ) + connectionParameter.getBindPrincipal() + ":", "", null ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
                    if ( dialog.open() == CredentialsDialog.OK )
                    {
                        pw[0] = dialog.getValue();
                    }
                    else
                    {
                        pw[0] = null;
                    }
                }
            } );

            if ( pw[0] == null )
            {
                return null;
            }
            else
            {
                return new Credentials( connectionParameter.getBindPrincipal(), pw[0], connectionParameter );
            }
        }

    }
View Full Code Here

Examples of org.apache.falcon.oozie.workflow.CREDENTIALS

     * @param workflowApp workflow xml
     * @param cluster     cluster entity
     */
    protected void addHCatalogCredentials(WORKFLOWAPP workflowApp, Cluster cluster,
                                          String credentialName) {
        CREDENTIALS credentials = workflowApp.getCredentials();
        if (credentials == null) {
            credentials = new CREDENTIALS();
        }

        credentials.getCredential().add(createHCatalogCredential(cluster, credentialName));

        // add credential for workflow
        workflowApp.setCredentials(credentials);
    }
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.Credentials

    XDR out = new XDR();
    InetAddress client = ((InetSocketAddress) info.remoteAddress())
        .getAddress();
    Channel channel = info.channel();

    Credentials credentials = rpcCall.getCredential();
    // Ignore auth only for NFSPROC3_NULL, especially for Linux clients.
    if (nfsproc3 != NFSPROC3.NULL) {
      if (credentials.getFlavor() != AuthFlavor.AUTH_SYS
          && credentials.getFlavor() != AuthFlavor.RPCSEC_GSS) {
        LOG.info("Wrong RPC AUTH flavor, " + credentials.getFlavor()
            + " is not AUTH_SYS or RPCSEC_GSS.");
        XDR reply = new XDR();
        RpcDeniedReply rdr = new RpcDeniedReply(xid,
            RpcReply.ReplyState.MSG_ACCEPTED,
            RpcDeniedReply.RejectState.AUTH_ERROR, new VerifierNone());
View Full Code Here

Examples of org.apache.hadoop.security.Credentials

  }

  private Token<? extends TokenIdentifier> generateDelegationToken(
      final NameNode namenode, final UserGroupInformation ugi,
      final String renewer) throws IOException {
    final Credentials c = DelegationTokenSecretManager.createCredentials(
        namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
    final Token<? extends TokenIdentifier> t = c.getAllTokens().iterator().next();
    t.setKind(WebHdfsFileSystem.TOKEN_KIND);
    SecurityUtil.setTokenService(t, namenode.getHttpAddress());
    return t;
  }
View Full Code Here

Examples of org.apache.http.auth.Credentials

          client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);

            //now set headers for auth
            AuthScope authScope = new AuthScope(AuthScope.ANY_HOST,
                    AuthScope.ANY_PORT, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME);
            Credentials credentials = proxyProperties.getCredentials();
            client.getCredentialsProvider().setCredentials(authScope, credentials);
        }

        return client;
    }
View Full Code Here

Examples of org.apache.http.auth.Credentials

            }
            ctx.setAttribute(ClientContext.SCHEME_REGISTRY, reg);
            connectionFuture = new BasicFuture<Boolean>(callback);
            DefaultHttpAsyncClient c = getHttpAsyncClient();
            CredentialsProvider credProvider = c.getCredentialsProvider();
            Credentials creds = (Credentials)outMessage.getContextualProperty(Credentials.class.getName());
            if (creds != null && credProvider != null) {
                credProvider.setCredentials(AuthScope.ANY, creds);
            }
            if (credProvider != null && credProvider.getCredentials(AuthScope.ANY) != null) {
                ctx.setAttribute(ClientContext.USER_TOKEN,
View Full Code Here

Examples of org.apache.http.auth.Credentials

        AuthScheme authScheme = authState.getAuthScheme();
        if (authScheme == null) {
            return;
        }
       
        Credentials creds = authState.getCredentials();
        if (creds == null) {
            this.log.debug("User credentials not available");
            return;
        }
View Full Code Here

Examples of org.apache.http.auth.Credentials

        AuthScheme authScheme = authState.getAuthScheme();
        if (authScheme == null) {
            return;
        }
       
        Credentials creds = authState.getCredentials();
        if (creds == null) {
            this.log.debug("User credentials not available");
            return;
        }
        if (authState.getAuthScope() != null || !authScheme.isConnectionBased()) {
View Full Code Here

Examples of org.apache.http.auth.Credentials

    // --------------------------------- Test Methods for Selecting Credentials
   
    public void testDefaultCredentials() throws Exception {
        BasicCredentialsProvider state = new BasicCredentialsProvider();
        Credentials expected = new UsernamePasswordCredentials("name", "pass");
        state.setCredentials(AuthScope.ANY, expected);
        Credentials got = state.getCredentials(DEFSCOPE);
        assertEquals(got, expected);
    }
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.