Class AuthApi
java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.AuthApi
Authentication related API calls.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangePassword(String currentPassword, String newPassword) Change the password of the account behind this client.voiddeleteToken(String username, long id) com.fasterxml.jackson.databind.node.ObjectNodeThe account behind this client: account, user, settings, features, organization.com.fasterxml.jackson.databind.node.ObjectNodeThe user's settings object as stored.com.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.node.ArrayNodelistTokens(String username) Personal access tokens of the given user.voidLogin anonymouslyvoidloginWithApiToken(String apiToken) Login with an API Token.com.fasterxml.jackson.databind.node.ObjectNodeloginWithUsernamePassword(String username, String password) Login with a username/password.voidlogout()Tell the server this session ends (the client itself is closed separately).voidRegister a new uservoidrequestEmailValidationToken(String username) The legacy name ofrequestValidationEmail(String); same behaviour.voidrequestPasswordReset(String username) Ask for a password-reset link for the address.voidrequestValidationEmail(String username) Ask the server to (re)send the validation email of a registered but not yet validated account.voidsaveSettings(com.fasterxml.jackson.databind.node.ObjectNode settings) Save user settings; only the known keys are copied by the server (fullName,countryCode,preferredLanguage,timeZoneId,bimContext,showDeletedNodes,emailAboutVulnarabilities).voidSign out every other session of the account behind this client; this client continues on the new token the server answers with.voidvalidateEmailAddress(String username, String token, String password) 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).Methods inherited from class SubApi
getBimWorksClient
-
Constructor Details
-
AuthApi
-
-
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
Login with an API Token. Generally you should not call this method manually, it is called already when creating a newBimWorksClientusingBimWorksClientFactory.createClientWithApiToken(String)- Parameters:
apiToken- The API Token- Throws:
BimWorksException
-
loginAnonymous
-
register
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
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
The legacy name ofrequestValidationEmail(String); same behaviour.- Throws:
BimWorksException
-
getAccountInfo
The account behind this client: account, user, settings, features, organization.- Throws:
BimWorksException
-
getSettings
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
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
Ask for a password-reset link for the address. Answers the same whether or not the address has an account.- Throws:
BimWorksException
-
signOutOtherSessions
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
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
- Throws:
BimWorksException
-
listCountries
- Throws:
BimWorksException
-
listLanguages
- Throws:
BimWorksException
-
listTimeZones
- Throws:
BimWorksException
-
listBimContexts
- Throws:
BimWorksException
-