Astra Unity 2.6.6
Astra Unity Plugin
|
Contains functionality to login customers with the Astra service, and other related operations More...
Classes | |
struct | Cookie |
Used to represent cookie data from the TyGetCookieData call More... | |
Public Types | |
enum | AuthError { Success = 0 , InvalidEmailOrPassword , EmailInUse , EmailNotRegistered , UnknownError } |
States of authentication errors for registration and logging in More... | |
Static Public Member Functions | |
static string | GetAppId () |
Returns the current app's id, this is the same as the application id on the admin portal. More... | |
static string | GetBaseUrl () |
Returns the base URL for Astra service requests More... | |
static string | GetCookie () |
Gets the full cookie necessary for authorizing Astra service API requests. This call will only result in a valid cookie after you successfully log a user in. Note this is the full cookie it may look something like "s=xyz..." where the prefix "s=" is the cookie name and "xyz..." is the cookie value In most cases you are looking for GetSessionId and RestoreSession. More... | |
static bool | TryGetCookieData (out Cookie cookie) |
Retrieves the Auth.Cookie from the session data. This gives you back the struct so you don't need to parse the cookie manually if you prefer. More... | |
static string | GetSessionId () |
Retrieves the session id without the cookie data. This means that if the cookie looks like "s=xyz..." you will get back "xyz..." This is useful when calling RestoreSession to log a user in at a future time. More... | |
static bool | SetEnvironmentCustom (string uri) |
Sets the Astra Service to target the specified environment, this is not normally called directly. Instead you should provide a ProjectConfiguration JSON to Configuration.Initialize instead. Your environment will look like https://[COMPANYNAME].maketafi.com More... | |
static LoginJob | LoginWithAstraId (string email, string password) |
Log into the Astra service, if you have your own IDs you likely want to use LoginRemote instead More... | |
static LoginJob | Login (string email, string password) |
Log into the Astra service, if you have your own IDs you likely want to use LoginRemote instead More... | |
static RemoteLoginJob | LoginRemote (string remoteType, string remoteId, string password) |
Login using a remote authentication provider More... | |
static RegisterJob | Register (string email, string handle, string password) |
Registers a new account using Tafi's account system, if you have your own IDs you likely want to use the RegisterRemote instead More... | |
static RegisterRemoteJob | RegisterRemote (string remoteType, string remoteId, string handle, string password) |
Registers a new account using a remote type, please ask the Astra Service for your appropriate remoteType string This is used for 3rd part systems where you don't want to create a astra id directly More... | |
static LoginRegisterRemoteJob | LoginRegisterRemote (string remoteType, string remoteId, string handle, string password) |
Combines logging and and registering in one job, see RegisterRemote and LoginRemote for instructions More... | |
static ForgotPasswordJob | ForgotPasswordForAstraId (string email) |
Institures a request to reset the user's password More... | |
static SetAppJob | SetApp (ulong appId, string secretKey) |
Set Application information, for use in cookies More... | |
static PingJob | PingAstra () |
Pings the Tafi servers to check for network connectivitiy and server status. Check the job's success state to determine if it was able to communicate properly. More... | |
static LogoutJob | Logout () |
Logout the active user More... | |
static RestoreSessionJob | RestoreSession (string sessionId) |
This is useful if you wish to maintin the user's session state with the Tafi server between application launches. Internally the Astra library does not permanently store the user's session/cookie data calling this function allows you to provide the cookie string and "relogin" the user. You can get the session id string from GetSessionId. More... | |
static WhoAmIJob | WhoAmI () |
Get User Information such as the the user id and handle via Astra.WhoAmIResult. More... | |
Contains functionality to login customers with the Astra service, and other related operations
enum Astra.Auth.AuthError |
States of authentication errors for registration and logging in
Enumerator | |
---|---|
Success | The request succeeded. |
InvalidEmailOrPassword | The request failed do to a bad email, rmeote id, or password. |
EmailInUse | The request failed do to a the email or remote id already being used. |
EmailNotRegistered | The request failed do to a the email or remote id not being found. |
UnknownError | The request failed do to an unknown error, check the native Astra logs. |
|
inlinestatic |
Institures a request to reset the user's password
Email attached to the user's account |
|
inlinestatic |
Returns the current app's id, this is the same as the application id on the admin portal.
|
inlinestatic |
Returns the base URL for Astra service requests
|
inlinestatic |
Gets the full cookie necessary for authorizing Astra service API requests. This call will only result in a valid cookie after you successfully log a user in. Note this is the full cookie it may look something like "s=xyz..." where the prefix "s=" is the cookie name and "xyz..." is the cookie value In most cases you are looking for GetSessionId and RestoreSession.
|
inlinestatic |
Retrieves the session id without the cookie data. This means that if the cookie looks like "s=xyz..." you will get back "xyz..." This is useful when calling RestoreSession to log a user in at a future time.
|
inlinestatic |
Log into the Astra service, if you have your own IDs you likely want to use LoginRemote instead
Email used for this account | |
password | Password for this account |
|
inlinestatic |
Combines logging and and registering in one job, see RegisterRemote and LoginRemote for instructions
remoteType | Type for the remote authentication as provided by Astra Service |
remoteId | ID for the remote user account specific to this app |
handle | User handle for this account |
pasword | Password for this account (currently must be 6 characters or longer) |
|
inlinestatic |
Login using a remote authentication provider
remoteType | Type for the remote authentication as provided by Astra Service |
remoteId | ID for the remote user account specific to this app |
password | Password for this account |
|
inlinestatic |
Log into the Astra service, if you have your own IDs you likely want to use LoginRemote instead
Email used for this account | |
password | Password for this account |
|
inlinestatic |
Logout the active user
|
inlinestatic |
Pings the Tafi servers to check for network connectivitiy and server status. Check the job's success state to determine if it was able to communicate properly.
|
inlinestatic |
Registers a new account using Tafi's account system, if you have your own IDs you likely want to use the RegisterRemote instead
A unique email for the user you want to register | |
handle | User handle for this account |
pasword | Password for this account (currently must be 6 characters or longer) |
|
inlinestatic |
Registers a new account using a remote type, please ask the Astra Service for your appropriate remoteType string This is used for 3rd part systems where you don't want to create a astra id directly
remoteType | Type for the remote authentication as provided by Astra Service |
remoteId | ID for the remote user account specific to this app |
handle | User handle for this account |
pasword | Password for this account (currently must be 6 characters or longer) |
|
inlinestatic |
This is useful if you wish to maintin the user's session state with the Tafi server between application launches. Internally the Astra library does not permanently store the user's session/cookie data calling this function allows you to provide the cookie string and "relogin" the user. You can get the session id string from GetSessionId.
sessionId | The id for the session to restore |
|
inlinestatic |
Set Application information, for use in cookies
appId | Application ID |
secretKey | Secret Key for the application |
|
inlinestatic |
Sets the Astra Service to target the specified environment, this is not normally called directly. Instead you should provide a ProjectConfiguration JSON to Configuration.Initialize instead. Your environment will look like https://[COMPANYNAME].maketafi.com
uri | Your custome URI such as "https://example.maketafi.com" |
|
inlinestatic |
Retrieves the Auth.Cookie from the session data. This gives you back the struct so you don't need to parse the cookie manually if you prefer.
cookie | The cookie the data will be inserted into |
|
inlinestatic |
Get User Information such as the the user id and handle via Astra.WhoAmIResult.