Examples of CredentialStore


Examples of com.ibm.sbt.security.credential.store.CredentialStore

        throw new ServletException("Missing OAuth token");
      }
      // Store the new key
      oAuthHandler.setAccessTokenObject(tk);
      if (!context.isCurrentUserAnonymous()) {
        CredentialStore cs = CredentialStoreFactory.getCredentialStore(oAuthHandler.getCredentialStore());
        if (cs != null) {
          // But we store it uniquely if the current user is not anonymous
          cs.store(oAuthHandler.getServiceName(), OAuth1Handler.ACCESS_TOKEN_STORE_TYPE, context.getCurrentUserId(), tk);
        }
      } else {
        AnonymousCredentialStore.storeCredentials(context, tk,
            oAuthHandler.getAppId(), oAuthHandler.getServiceName());
      }
View Full Code Here

Examples of com.ibm.sbt.security.credential.store.CredentialStore

      oAuthHandler.getAccessTokenForAuthorizedUser(); // This retrieves and sets all authentication information in OAuth2Handler
      AccessToken token = oAuthHandler.createToken(oAuthHandler.getAppId(),oAuthHandler.getServiceName());
            // Store the new key
      oAuthHandler.setAccessTokenObject(token);
          if(!context.isCurrentUserAnonymous()) {
            CredentialStore credStore = CredentialStoreFactory.getCredentialStore(oAuthHandler.getCredentialStore());
            if(credStore!=null) {
              credStore.store(oAuthHandler.getServiceName(), OAuth2Handler.ACCESS_TOKEN_STORE_TYPE, context.getCurrentUserId(), token);
              }
            } else {
              // Store the token for anonymous user
              AnonymousCredentialStore.storeCredentials(context, token, oAuthHandler.getAppId(), oAuthHandler.getServiceName());
            }
View Full Code Here

Examples of com.ibm.sbt.security.credential.store.CredentialStore

          if(!storeAlreadyTried) {
              synchronized (this) {
              Context context = Context.getUnchecked();
              if (context != null) {
                    UserPassword u = null;
                  CredentialStore cs = CredentialStoreFactory.getCredentialStore(getCredentialStore());
                  if(cs!=null) {
                      u = (UserPassword)cs.load(getUrl(),STORE_TYPE,context.getCurrentUserId());
                  }
                    if(u!=null) {
                        this.user = u.getUser();
                        this.password = u.getPassword();
                        return true;
View Full Code Here

Examples of com.ibm.sbt.security.credential.store.CredentialStore

    public boolean writeToStore() throws AuthenticationException {
      try {
        Context context = Context.getUnchecked();
        if (context != null) {
          CredentialStore cs = CredentialStoreFactory.getCredentialStore(getCredentialStore());
            if(cs!=null) {
              UserPassword u = new UserPassword(user,password);
                cs.store(getUrl(), STORE_TYPE, context.getCurrentUserId(), u);
                return true;
            }
        }
          return false;
      } catch(CredentialStoreException ex) {
View Full Code Here

Examples of com.ibm.sbt.security.credential.store.CredentialStore

    public boolean clearFromStore() throws AuthenticationException {
      try {
        Context context = Context.getUnchecked();
        if (context != null) {
          CredentialStore cs = CredentialStoreFactory.getCredentialStore(getCredentialStore());
            if(cs!=null) {
                cs.remove(getUrl(), STORE_TYPE, context.getCurrentUserId());
                return true;
            }
        }
          return false;
    } catch(CredentialStoreException ex) {
View Full Code Here

Examples of oracle.security.jps.service.credstore.CredentialStore

//  createCred(map="JPS",key="AD_ldap",user="CN=Administrator,CN=Users,DC=alfa,DC=local",password="Welcome02" ,desc="Windows LDAP user")
//  exit()

    public void retrievePassword(ActionEvent actionEvent) {
      try {
          CredentialStore store = jpsCtx.getServiceInstance(CredentialStore.class);
          PasswordCredential password =
              (PasswordCredential)store.getCredential(this.getMap(),
                                                      this.getKey());
          this.keyUsername = password.getName();
          this.keyPassword = new String(password.getPassword());

        FacesMessage fm = new FacesMessage("Succes");
View Full Code Here

Examples of org.apache.geronimo.security.credentialstore.CredentialStore

        SecurityHolder securityHolder = new SecurityHolder();
        securityHolder.setSecurity(true);
        securityHolder.setPolicyContextID(POLICY_CONTEXT_ID);
//        securityHolder.setDefaultSubject(defaultPrincipal);
        securityHolder.setSecurityRealm(securityRealmName);
        CredentialStore credentialStore = null;
        return setUpSecureAppContext(roleDesignates,
                principalRoleMap,
                componentPermissions,
                null,
                securityHolder,
View Full Code Here

Examples of org.apache.geronimo.security.credentialstore.CredentialStore

        PermissionCollection uncheckedPermissions = new Permissions();
        ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions, uncheckedPermissions, new HashMap());
        //Force a new realm name and ignore the application name
        SecurityHolder securityHolder = new SecurityHolder();
        securityHolder.setSecurityRealm(securityRealmName);
        CredentialStore credentialStore = null;
        setUpSecureAppContext(new HashMap(),
                new HashMap(),
                componentPermissions,
                realm,
                securityHolder,
View Full Code Here

Examples of org.apache.geronimo.security.credentialstore.CredentialStore

        ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions, uncheckedPermissions, new HashMap());
        //Force a new realm name and ignore the application name
        SecurityHolder securityHolder = new SecurityHolder();
        securityHolder.setSecurity(false);//redundant: forces use of TomcatJAASRealm not TomcatGeronimoRealm
        securityHolder.setConfigurationFactory(this.realm);
        CredentialStore credentialStore = null;
        setUpSecureAppContext(new HashMap(),
                new HashMap(),
                componentPermissions,
                null,
                securityHolder
View Full Code Here

Examples of org.apache.geronimo.security.credentialstore.CredentialStore

        ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions, uncheckedPermissions, new HashMap());
        //Force a new realm name and ignore the application name
        SecurityHolder securityHolder = new SecurityHolder();
        securityHolder.setSecurity(false);//redundant: forces use of TomcatJAASRealm not TomcatGeronimoRealm
        securityHolder.setConfigurationFactory(this.realm);
        CredentialStore credentialStore = null;
        WebAppInfo webAppInfo = new WebAppInfo();
        webAppInfo.loginConfig = new LoginConfigInfo();
        webAppInfo.loginConfig.authMethod = "FORM";
        webAppInfo.loginConfig.realmName = "geronimo-admin";
        webAppInfo.loginConfig.formLoginPage = "/auth/logon.html?param=test";
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.