Package de.florianreuth.waybackauthlib
Class WaybackAuthLib
java.lang.Object
de.florianreuth.waybackauthlib.WaybackAuthLib
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the authentication service.WaybackAuthLib(String authHost) Creates a new instance of the authentication service.WaybackAuthLib(String authHost, String clientToken) Creates a new instance of the authentication service.WaybackAuthLib(String authHost, String clientToken, Proxy proxy) Creates a new instance of the authentication service. -
Method Summary
Modifier and TypeMethodDescriptionbooleancom.mojang.authlib.GameProfileList<com.mojang.authlib.GameProfile>List<com.mojang.authlib.properties.Property>booleanvoidlogIn()Logs in the user with the provided credentials.voidlogOut()Logs out the user and invalidates the access token.voidsetAccessToken(String accessToken) Sets the access token.voidsetPassword(String password) Sets the password.voidsetUsername(String username) Sets the username.toString()
-
Field Details
-
YGG_PROD
- See Also:
-
-
Constructor Details
-
WaybackAuthLib
public WaybackAuthLib()Creates a new instance of the authentication service. -
WaybackAuthLib
Creates a new instance of the authentication service.- Parameters:
authHost- The host of the authentication service. (e.g. Mojang AuthServer)
-
WaybackAuthLib
Creates a new instance of the authentication service.- Parameters:
authHost- The host of the authentication service. (e.g. Mojang AuthServer)clientToken- The client token. (e.g. "")
-
WaybackAuthLib
Creates a new instance of the authentication service.- Parameters:
authHost- The host of the authentication service. (e.g. Mojang AuthServer)clientToken- The client token. (e.g. "")proxy- The proxy to use for the requests.
-
-
Method Details
-
logIn
Logs in the user with the provided credentials. If the user is already logged in, it will refresh the access token.- Throws:
InvalidCredentialsException- If the provided credentials are invalid.Exception- If the server didn't send a response or the client token doesn't match.
-
checkTokenValidity
public boolean checkTokenValidity() -
logOut
Logs out the user and invalidates the access token. If the user is not logged in, it will do nothing.- Throws:
Exception- If the server didn't send a response or the client token doesn't match.
-
getUsername
-
setUsername
Sets the username. If the user is logged in, it will throw an exception.- Parameters:
username- The username.
-
getPassword
-
setPassword
Sets the password. If the user is logged in, it will throw an exception.- Parameters:
password- The password.
-
getAccessToken
-
setAccessToken
Sets the access token. If the user is logged in, it will throw an exception.- Parameters:
accessToken- The access token.
-
getUserId
-
isLoggedIn
public boolean isLoggedIn() -
getCurrentProfile
public com.mojang.authlib.GameProfile getCurrentProfile() -
getProperties
-
getProfiles
-
toString
-