Package com.ibm.sbt.security.credential.store

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


                  CredentialStore credStore = findCredentialStore();
                  if (credStore != null) {
                // if the token is already present, and was expired due to which we have fetched a new
                // token, then we remove the token from the store first and then add this new token.
                deleteToken();
                credStore.store(getServiceName(), ACCESS_TOKEN_STORE_TYPE, getUserId(), token);
              }
                  } else {
                    AnonymousCredentialStore.storeCredentials(context, token, getAppId(), getServiceName()); // Store the token for anonymous user
                  }
          } catch (CredentialStoreException cse) {
View Full Code Here


        if (credStore != null) {
          try {
            // if the token is already present, and was expired due to which we have fetched a new
            // token, then we remove the token from the store first and then add this new token.
            deleteToken();
            credStore.store(getServiceName(), ACCESS_TOKEN_STORE_TYPE, getUserId(), token);
          } catch (CredentialStoreException cse) {
            throw new OAuthException(cse);
          }
        }
      } else {
View Full Code Here

      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

            // 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

        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

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.