Tabnine Logo
Credentials
Code IndexAdd Tabnine to your IDE (free)

How to use
Credentials
in
com.oberasoftware.jasdb.api.security

Best Java code snippets using com.oberasoftware.jasdb.api.security.Credentials (Showing top 3 results out of 315)

origin: oberasoftware/jasdb

@Override
public User authenticate(Credentials credentials) throws JasDBStorageException {
  return credentialsProvider.getUser(credentials.getUsername(), credentials.getSourceHost(), credentials.getPassword());
}
origin: oberasoftware/jasdb

@Override
protected void authenticate(Credentials credentials) throws JasDBStorageException {
  if(credentials != null) {
    TokenConnector tokenConnector = RemoteConnectorFactory.createConnector(getNodeInformation(), TokenConnector.class);
    UserSession session = tokenConnector.loadSession(credentials.getUsername(), credentials.getPassword());
    if(StringUtils.stringNotEmpty(session.getAccessToken()) && StringUtils.stringNotEmpty(session.getSessionId())) {
      context = new RemotingContext(true);
      context.setUserSession(session);
      LOG.debug("Token: {} session: {}", session.getAccessToken(), session.getSessionId());
    } else {
      throw new JasDBSecurityException("Unable to obtain access token to service");
    }
  } else {
    context = new RemotingContext(true);
  }
}
origin: oberasoftware/jasdb

@Override
public UserSession startSession(Credentials credentials) throws JasDBStorageException {
  User user = userManager.authenticate(credentials);
  String sessionId = UUID.randomUUID().toString();
  String token = UUID.randomUUID().toString();
  CryptoEngine userEncryptionEngine = CryptoFactory.getEngine(user.getEncryptionEngine());
  String encryptedContentKey = user.getEncryptedContentKey();
  String contentKey = userEncryptionEngine.decrypt(user.getPasswordSalt(), credentials.getPassword(), encryptedContentKey);
  encryptedContentKey = userEncryptionEngine.encrypt(user.getPasswordSalt(), token, contentKey);
  UserSession session = new UserSessionImpl(sessionId, token, encryptedContentKey, user);
  userManager.authorize(session, "/", AccessMode.CONNECT);
  secureUserSessionMap.put(sessionId, new SecureUserSession(session));
  return session;
}
com.oberasoftware.jasdb.api.securityCredentials

Javadoc

User: renarj Date: 1/22/12 Time: 3:24 PM

Most used methods

  • getPassword
  • getUsername
  • getSourceHost

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now