Package com.bitheads.braincloud.services
Class AuthenticationService
java.lang.Object
com.bitheads.braincloud.services.AuthenticationService
public class AuthenticationService extends Object
-
Constructor Summary
Constructors Constructor Description AuthenticationService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidauthenticateAdvanced(AuthenticationType authenticationType, AuthenticationIds ids, boolean forceCreate, String extraJson, IServerCallback callback)voidauthenticateAnonymous(boolean forceCreate, IServerCallback callback)Authenticate a user anonymously with brainCloud - used for apps that don't want to bother the user to login, or for users who are sensitive to their privacyvoidauthenticateAnonymous(String anonymousId, boolean forceCreate, IServerCallback callback)Overloaded for users not using wrapper, they will need to create their own anonId.voidauthenticateApple(String appleUserId, String identityToken, boolean forceCreate, IServerCallback callback)Authenticate the user using an apple idvoidauthenticateEmailPassword(String email, String password, boolean forceCreate, IServerCallback callback)Authenticate the user with a custom Email and Password.voidauthenticateExternal(String userId, String token, String externalAuthName, boolean forceCreate, IServerCallback callback)Authenticate the user via cloud code (which in turn validates the supplied credentials against an external system).voidauthenticateFacebook(String fbUserId, String fbAuthToken, boolean forceCreate, IServerCallback callback)Authenticate the user with brainCloud using their Facebook CredentialsvoidauthenticateFacebookLimited(String fbLimitedUserId, String fbAuthToken, boolean forceCreate, IServerCallback callback)Authenticate the user with brainCloud using their FacebookLimited CredentialsvoidauthenticateGoogle(String googleUserId, String serverAuthCode, boolean forceCreate, IServerCallback callback)Authenticate the user using a google userid(email address) and google authentication token.voidauthenticateGoogleOpenId(String googleUserAccountEmail, String IdToken, boolean forceCreate, IServerCallback callback)Authenticate the user using a google userid(email address) and google openid token.voidauthenticateHandoff(String handoffId, String securityToken, IServerCallback callback)Authenticate the user using a handoffId and an authentication token.voidauthenticateOculus(String oculusUserId, String oculusNonce, boolean forceCreate, IServerCallback callback)Authenticate the user with brainCloud using their Oculus CredentialsvoidauthenticateParse(String userId, String authenticationToken, boolean forceCreate, IServerCallback callback)Authenticate the user using a Parse user ID authentication token.voidauthenticateSettopHandoff(String handoffCode, IServerCallback callback)Authenticate the user using a handoffId and an authentication token.voidauthenticateSteam(String steamUserId, String steamSessionTicket, boolean forceCreate, IServerCallback callback)Authenticate the user using a steam userid and session ticket (without any validation on the userid).voidauthenticateTwitter(String userId, String token, String secret, boolean forceCreate, IServerCallback callback)Authenticate the user using a Twitter userid, authentication token, and secret from Twitter.voidauthenticateUltra(String ultraUsername, String ultraIdToken, boolean forceCreate, IServerCallback callback)Authenticate the user for Ultra.voidauthenticateUniversal(String userId, String userPassword, boolean forceCreate, IServerCallback callback)Authenticate the user using a userid and password (without any validation on the userid).voidclearSavedProfileId()Used to clear the saved profile id - to use in cases when the user is attempting to switch to a different game profile.StringgenerateAnonymousId()Used to create the anonymous installation id for the brainCloud profile.StringgetAnonymousId()StringgetProfileId()voidinitialize(String profileId, String anonymousId)Initialize - initializes the identity service with a saved anonymous installation ID and most recently used profile IDvoidresetEmailPassword(String email, IServerCallback callback)Reset Email password - Sends a password reset email to the specified addressvoidresetEmailPasswordAdvanced(String email, String serviceParams, IServerCallback callback)Reset Email password with service parameters - sends a password reset email to the specified addressvoidresetEmailPasswordAdvancedWithExpiry(String email, String serviceParams, int tokenTtlInMinutes, IServerCallback callback)Reset Email password with service parameters and expiry token - sends a password reset email to the specified addressvoidresetEmailPasswordWithExpiry(String email, int tokenTtlInMinutes, IServerCallback callback)Reset Email password with expiry - Sends a password reset email to the specified addressvoidresetUniversalIdPassword(String universalId, IServerCallback callback)Reset password of universalIdvoidresetUniversalIdPasswordAdvanced(String universalId, String serviceParams, IServerCallback callback)Reset universal Ids password of universalId with template optionsvoidresetUniversalIdPasswordAdvancedWithExpiry(String universalId, String serviceParams, int tokenTtlInMinutes, IServerCallback callback)Reset universal Ids password of universalId with template options with expiry tokenvoidresetUniversalIdPasswordWithExpiry(String universalId, int tokenTtlInMinutes, IServerCallback callback)Reset password of universalId with expiry tokenvoidretryPreviousAuthenticate(IServerCallback callback)voidsetAnonymousId(String anonymousId)voidsetProfileId(String profileId)
-
Constructor Details
-
AuthenticationService
-
-
Method Details
-
getAnonymousId
-
setAnonymousId
-
getProfileId
-
setProfileId
-
retryPreviousAuthenticate
-
initialize
Initialize - initializes the identity service with a saved anonymous installation ID and most recently used profile ID- Parameters:
anonymousId- The anonymous installation id that was generated for this deviceprofileId- The id of the profile id that was most recently used by the app (on this device)
-
clearSavedProfileId
public void clearSavedProfileId()Used to clear the saved profile id - to use in cases when the user is attempting to switch to a different game profile. -
generateAnonymousId
Used to create the anonymous installation id for the brainCloud profile.- Returns:
- A unique Anonymous ID
-
authenticateAnonymous
Authenticate a user anonymously with brainCloud - used for apps that don't want to bother the user to login, or for users who are sensitive to their privacy- Parameters:
forceCreate- Should a new profile be created if it does not exist?callback- The callback handler
-
authenticateAnonymous
public void authenticateAnonymous(String anonymousId, boolean forceCreate, IServerCallback callback)Overloaded for users not using wrapper, they will need to create their own anonId. Authenticate a user anonymously with brainCloud - used for apps that don't want to bother the user to login, or for users who are sensitive to their privacy.- Parameters:
anonymousId- The anonymous id of the userforceCreate- Should a new profile be created if it does not exist?callback- The callback handler
-
authenticateEmailPassword
public void authenticateEmailPassword(String email, String password, boolean forceCreate, IServerCallback callback)Authenticate the user with a custom Email and Password. Note that the client app is responsible for collecting (and storing) the e-mail and potentially password (for convenience) in the client data. For the greatest security, force the user to re-enter their password at each login. (Or at least give them that option). Note that the password sent from the client to the server is protected via SSL.- Parameters:
email- The e-mail address of the userpassword- The password of the userforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateExternal
public void authenticateExternal(String userId, String token, String externalAuthName, boolean forceCreate, IServerCallback callback)Authenticate the user via cloud code (which in turn validates the supplied credentials against an external system). This allows the developer to extend brainCloud authentication to support other backend authentication systems. Service Name - Authenticate Server Operation - Authenticate- Parameters:
userId- The user idtoken- The user token (password etc)externalAuthName- The name of the cloud script to call for external authenticationforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateFacebook
public void authenticateFacebook(String fbUserId, String fbAuthToken, boolean forceCreate, IServerCallback callback)Authenticate the user with brainCloud using their Facebook Credentials- Parameters:
fbUserId- The facebook id of the userfbAuthToken- The validated token from the Facebook SDK (that will be further validated when sent to the bC service)forceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateFacebookLimited
public void authenticateFacebookLimited(String fbLimitedUserId, String fbAuthToken, boolean forceCreate, IServerCallback callback)Authenticate the user with brainCloud using their FacebookLimited Credentials- Parameters:
fbLimitedUserId- The facebookLimited id of the userfbAuthToken- The validated token from the Facebook SDK (that will be further validated when sent to the bC service)forceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateOculus
public void authenticateOculus(String oculusUserId, String oculusNonce, boolean forceCreate, IServerCallback callback)Authenticate the user with brainCloud using their Oculus Credentials- Parameters:
oculusUserId- The oculus id of the useroculusNonce- Validation token from oculus gotten through the oculus sdkforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateApple
public void authenticateApple(String appleUserId, String identityToken, boolean forceCreate, IServerCallback callback)Authenticate the user using an apple id- Parameters:
appleUserId- This can be the user id OR the email of the user for the accountidentityToken- The token confirming the user's identityforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateGoogle
public void authenticateGoogle(String googleUserId, String serverAuthCode, boolean forceCreate, IServerCallback callback)Authenticate the user using a google userid(email address) and google authentication token.- Parameters:
googleUserId- String representation of google+ userId. Gotten with calls like RequestUserIdserverAuthCode- The server authentication token derived via the google apis. Gotten with calls like RequestServerAuthCodeforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateGoogleOpenId
public void authenticateGoogleOpenId(String googleUserAccountEmail, String IdToken, boolean forceCreate, IServerCallback callback)Authenticate the user using a google userid(email address) and google openid token.- Parameters:
googleUserAccountEmail- The email associated with the google userIdToken- The id token of the google account. Can get with calls like requestIdTokenforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateSteam
public void authenticateSteam(String steamUserId, String steamSessionTicket, boolean forceCreate, IServerCallback callback)Authenticate the user using a steam userid and session ticket (without any validation on the userid).- Parameters:
steamUserId- String representation of 64 bit steam idsteamSessionTicket- The session ticket of the user (hex encoded)forceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateUltra
public void authenticateUltra(String ultraUsername, String ultraIdToken, boolean forceCreate, IServerCallback callback)Authenticate the user for Ultra.- Parameters:
ultraUsername- it's what the user uses to log into the Ultra endpoint initiallyultraIdToken- The "id_token" taken from Ultra's JWT.forceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateTwitter
public void authenticateTwitter(String userId, String token, String secret, boolean forceCreate, IServerCallback callback)Authenticate the user using a Twitter userid, authentication token, and secret from Twitter. Service Name - Authenticate Service Operation - Authenticate- Parameters:
userId- String representation of Twitter useridtoken- The authentication token derived via the Twitter apis.secret- The secret given when attempting to link with TwitterforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateUniversal
public void authenticateUniversal(String userId, String userPassword, boolean forceCreate, IServerCallback callback)Authenticate the user using a userid and password (without any validation on the userid). Similar to AuthenticateEmailPassword - except that that method has additional features to allow for e-mail validation, password resets, etc.- Parameters:
userId- The id of the useruserPassword- The password of the userforceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateAdvanced
public void authenticateAdvanced(AuthenticationType authenticationType, AuthenticationIds ids, boolean forceCreate, String extraJson, IServerCallback callback) -
authenticateParse
public void authenticateParse(String userId, String authenticationToken, boolean forceCreate, IServerCallback callback)Authenticate the user using a Parse user ID authentication token.- Parameters:
userId- String representation of Parse user IDauthenticationToken- The authentication token derived via the google apis.forceCreate- Should a new profile be created for this user if the account does not exist?callback- The callback handler
-
authenticateHandoff
Authenticate the user using a handoffId and an authentication token.- Parameters:
handoffId- braincloud handoffId generated frim cloud scriptsecurityToken- The authentication tokencallback- The callback handler
-
authenticateSettopHandoff
Authenticate the user using a handoffId and an authentication token.- Parameters:
handoffCode- generate in cloud codecallback- The callback handler
-
resetEmailPassword
Reset Email password - Sends a password reset email to the specified address- Parameters:
email- The email address to send the reset email to.callback- The callback handler Note the follow error reason codes: SECURITY_ERROR (40209) - If the email address cannot be found.
-
resetEmailPasswordAdvanced
public void resetEmailPasswordAdvanced(String email, String serviceParams, IServerCallback callback)Reset Email password with service parameters - sends a password reset email to the specified address- Parameters:
email- the email address to send the reset email toserviceParams- parameters to send to the email service. see documentation for full list. http://getbraincloud.com/apidocs/apiref/#capi-mailcallback- The callback handler Note the follow error reason codes: SECURITY_ERROR (40209) - If the email address cannot be found.
-
resetEmailPasswordWithExpiry
public void resetEmailPasswordWithExpiry(String email, int tokenTtlInMinutes, IServerCallback callback)Reset Email password with expiry - Sends a password reset email to the specified address- Parameters:
email- The email address to send the reset email to.tokenTtlInMinutes- , expiry token in minscallback- The callback handler Note the follow error reason codes: SECURITY_ERROR (40209) - If the email address cannot be found.
-
resetEmailPasswordAdvancedWithExpiry
public void resetEmailPasswordAdvancedWithExpiry(String email, String serviceParams, int tokenTtlInMinutes, IServerCallback callback)Reset Email password with service parameters and expiry token - sends a password reset email to the specified address- Parameters:
email- the email address to send the reset email toserviceParams- parameters to send to the email service. see documentation for full list. http://getbraincloud.com/apidocs/apiref/#capi-mailtokenTtlInMinutes- , expiry token in minscallback- The callback handler Note the follow error reason codes: SECURITY_ERROR (40209) - If the email address cannot be found.
-
resetUniversalIdPassword
Reset password of universalId- Parameters:
universalId- The users universalIdcallback- The callback handler
-
resetUniversalIdPasswordAdvanced
public void resetUniversalIdPasswordAdvanced(String universalId, String serviceParams, IServerCallback callback)Reset universal Ids password of universalId with template options- Parameters:
universalId- the email address to send the reset email toserviceParams- parameters to send to the service. see documentation for full list. http://getbraincloud.com/apidocs/apiref/#capi-mailcallback- The callback handler
-
resetUniversalIdPasswordWithExpiry
public void resetUniversalIdPasswordWithExpiry(String universalId, int tokenTtlInMinutes, IServerCallback callback)Reset password of universalId with expiry token- Parameters:
universalId- The users universalIdtokenTtlInMinutes- , expiry token in minscallback- The callback handler
-
resetUniversalIdPasswordAdvancedWithExpiry
public void resetUniversalIdPasswordAdvancedWithExpiry(String universalId, String serviceParams, int tokenTtlInMinutes, IServerCallback callback)Reset universal Ids password of universalId with template options with expiry token- Parameters:
universalId- the email address to send the reset email toserviceParams- parameters to send to the service. see documentation for full list. http://getbraincloud.com/apidocs/apiref/#capi-mailtokenTtlInMinutes- , expiry token in minscallback- The callback handler
-