Tabnine Logo
SessionManager.startSession
Code IndexAdd Tabnine to your IDE (free)

How to use
startSession
method
in
com.oberasoftware.jasdb.api.security.SessionManager

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

origin: oberasoftware/jasdb

/**
 * Creates a local DB session with credentials
 * @param credentials The credentials
 * @throws JasDBStorageException If unable to request the session
 */
public LocalDBSession(Credentials credentials) throws JasDBException {
  this();
  SessionManager sessionManager = ApplicationContextProvider.getApplicationContext().getBean(SessionManager.class);
  userSession = sessionManager.startSession(credentials);
}
origin: oberasoftware/jasdb

/**
 * Creates a local DB session bound to a specific instance with given credentials
 * @param instanceId The instance
 * @param credentials The credentials
 * @throws JasDBStorageException If unable to request the session
 */
public LocalDBSession(String instanceId, Credentials credentials) throws JasDBException {
  this(instanceId);
  SessionManager sessionManager = ApplicationContextProvider.getApplicationContext().getBean(SessionManager.class);
  userSession = sessionManager.startSession(credentials);
}
origin: oberasoftware/jasdb

@RequestMapping(method = RequestMethod.POST, value = "/token", produces = "application/json", consumes = "application/json")
public @ResponseBody
ResponseEntity<String> getToken(HttpServletRequest request) {
  if(request.isSecure()) {
    try {
      String clientId = request.getParameter("client_id");
      String clientSecret = request.getParameter("client_secret");
      LOG.debug("Client: {} host: {}", clientId, request.getRemoteHost());
      UserSession session = sessionManager.startSession(new BasicCredentials(clientId, request.getRemoteHost(), clientSecret));
      LOG.debug("Loaded session: {}", session);
      String responseMessage = String.format(GRANT_VALID, session.getAccessToken(), session.getSessionId(), "jasdb", 3600);
      return new ResponseEntity<>(responseMessage, HttpStatus.OK);
    } catch(JasDBSecurityException e) {
      return getErrorResponse("Invalid credentials");
    } catch(JasDBStorageException e) {
      return getErrorResponse("Unknown error");
    }
  } else {
    return getErrorResponse("Insecure connection");
  }
}
com.oberasoftware.jasdb.api.securitySessionManagerstartSession

Popular methods of SessionManager

  • getSession
  • sessionValid

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JComboBox (javax.swing)
  • JFileChooser (javax.swing)
  • From CI to AI: The AI layer in your organization
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