Package org.exoplatform.bluemind.client
Interface BlueMindAuthenticator
- All Known Implementing Classes:
BlueMindRestClient
public interface BlueMindAuthenticator
BlueMind's two authentication doors,
/api/auth/login and
/api/auth/_su, as BlueMindSessionStorage spends them.
BlueMindRestClient is the one implementation; the interface exists
so that the storage's single-flight and retry rules are tested against a
hand-written double rather than a server.-
Method Summary
Modifier and TypeMethodDescriptionlogin(BlueMindAccount account) Opens a session for an account, from its own password.Opens a session in the name of another account, from a technical account's own session.
-
Method Details
-
login
Opens a session for an account, from its own password.- Parameters:
account- the server, the login, the password and the origin- Returns:
- the session BlueMind opened
- Throws:
BlueMindAuthenticationException- when BlueMind refuses the credentialsBlueMindUnreachableException- when BlueMind cannot be reached or does not answer in timeBlueMindException- on any other failure, including a missing piece of configuration
-
sudo
Opens a session in the name of another account, from a technical account's own session.- Parameters:
apiRoot- any address on the servertechnicalAuthKey- the technical account's session keytargetLogin- the account to act as- Returns:
- the session BlueMind opened for that account
- Throws:
BlueMindSessionRefusedException- when BlueMind refuses the technical session itself (HTTP 401)BlueMindAuthenticationException- when BlueMind refuses the sudo in its answer (status: Bad)BlueMindException- on any other failure
-