Class AuthApi

java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.AuthApi

public class AuthApi extends SubApi
Authentication related API calls.
  • Constructor Details

  • Method Details

    • loginWithUsernamePassword

      public com.fasterxml.jackson.databind.node.ObjectNode loginWithUsernamePassword(String username, String password) throws BimWorksException
      Login with a username/password. Only use this for testing purposes, in most cases using an API Token is safer.
      Parameters:
      username -
      password -
      Returns:
      Throws:
      BimWorksException
    • loginWithApiToken

      public void loginWithApiToken(String apiToken) throws BimWorksException
      Login with an API Token. Generally you should not call this method manually, it is called already when creating a new BimWorksClient using BimWorksClientFactory.createClientWithApiToken(String)
      Parameters:
      apiToken - The API Token
      Throws:
      BimWorksException
    • loginAnonymous

      public void loginAnonymous() throws BimWorksException
      Login anonymously
      Throws:
      BimWorksException
    • register

      public void register(String username) throws BimWorksException
      Register a new user
      Parameters:
      username - The requested username, should always be in the form of a valid email address
      Throws:
      BimWorksException
    • validateEmailAddress

      public void validateEmailAddress(String username, String token, String password) throws BimWorksException
      Complete a registration: the token from the validation email, and the password the new account gets (the server asks for the password at validation time).
      Throws:
      BimWorksException
    • requestValidationEmail

      public void requestValidationEmail(String username) throws BimWorksException
      Ask the server to (re)send the validation email of a registered but not yet validated account. Answers the same whether or not the address has an account; a confirmed account gets nothing.
      Throws:
      BimWorksException
    • requestEmailValidationToken

      public void requestEmailValidationToken(String username) throws BimWorksException
      The legacy name of requestValidationEmail(String); same behaviour.
      Throws:
      BimWorksException
    • getAccountInfo

      public com.fasterxml.jackson.databind.node.ObjectNode getAccountInfo() throws BimWorksException
      The account behind this client: account, user, settings, features, organization.
      Throws:
      BimWorksException
    • getSettings

      public com.fasterxml.jackson.databind.node.ObjectNode getSettings() throws BimWorksException
      The user's settings object as stored.
      Throws:
      BimWorksException
    • saveSettings

      public void saveSettings(com.fasterxml.jackson.databind.node.ObjectNode settings) throws BimWorksException
      Save user settings; only the known keys are copied by the server (fullName, countryCode, preferredLanguage, timeZoneId, bimContext, showDeletedNodes, emailAboutVulnarabilities).
      Throws:
      BimWorksException
    • changePassword

      public void changePassword(String currentPassword, String newPassword) throws BimWorksException
      Change the password of the account behind this client. The server signs out every other session of the account and answers with a new token for this one, which the client adopts.
      Throws:
      BimWorksException
    • requestPasswordReset

      public void requestPasswordReset(String username) throws BimWorksException
      Ask for a password-reset link for the address. Answers the same whether or not the address has an account.
      Throws:
      BimWorksException
    • signOutOtherSessions

      public void signOutOtherSessions() throws BimWorksException
      Sign out every other session of the account behind this client; this client continues on the new token the server answers with.
      Throws:
      BimWorksException
    • logout

      public void logout() throws BimWorksException
      Tell the server this session ends (the client itself is closed separately).
      Throws:
      BimWorksException
    • listTokens

      public com.fasterxml.jackson.databind.node.ArrayNode listTokens(String username) throws BimWorksException
      Personal access tokens of the given user.
      Throws:
      BimWorksException
    • deleteToken

      public void deleteToken(String username, long id) throws BimWorksException
      Throws:
      BimWorksException
    • listCountries

      public com.fasterxml.jackson.databind.JsonNode listCountries() throws BimWorksException
      Throws:
      BimWorksException
    • listLanguages

      public com.fasterxml.jackson.databind.JsonNode listLanguages() throws BimWorksException
      Throws:
      BimWorksException
    • listTimeZones

      public com.fasterxml.jackson.databind.JsonNode listTimeZones() throws BimWorksException
      Throws:
      BimWorksException
    • listBimContexts

      public com.fasterxml.jackson.databind.JsonNode listBimContexts() throws BimWorksException
      Throws:
      BimWorksException