-
Notifications
You must be signed in to change notification settings - Fork 14
User authentication
We authenticate users via a simple email verification flow - which is used to generate OAuth 2 access tokens. A user can manage the tokens they have been issued via their OAuth 2 token page.
Authentication occurs by asking for their email and then for the 5-digit security code sent to their email. To do so, first call emailRequest to send the email and then emailExchange to exchange the security code for an access token that will be handled internally by the SDK so you won't need to deal with it.
API endpoint: Authentincation
Request a security_code be sent to the email address of the user you wish to authenticate.
Name | Type | Description |
---|---|---|
FString |
A valid and secure email address your user has access to. |
Name | Type | Description |
---|---|---|
Response | FModioResponse |
FModioResponse object that contains the mod.io response status. |
UCLASS()
class UMyEmailRequestCallbackProxy : public UEmailRequestCallbackProxy
{
GENERATED_BODY()
void OnEmailRequestDelegate(FModioResponse Response) override
{
// Your callback code goes here
}
};
[...]
UMyEmailRequestCallbackProxy* MyEmailRequest;
MyEmailRequest = NewObject<UMyEmailRequestCallbackProxy>();
MyEmailRequest->Email = "[email protected]";
MyEmailRequest->Activate();
API endpoint: Authentincation
Exchanges the 5-digit code for an authentication token. The token is handled internally by the SDK.
Name | Type | Description |
---|---|---|
security_code | FString |
Unique 5-digit code sent to the email address supplied in the previous request.. |
Name | Type | Description |
---|---|---|
Response | FModioResponse |
FModioResponse object that contains the mod.io response status. |
UCLASS()
class UMyEmailExchangeCallbackProxy : public UEmailExchangeCallbackProxy
{
GENERATED_BODY()
void OnEmailExchangeDelegate(FModioResponse Response) override
{
// Your callback code goes here
}
};
[...]
UMyEmailExchangeCallbackProxy* MyEmailExchange;
MyEmailExchange= NewObject<UMyEmailExchangeCallbackProxy>();
MyEmailExchange->SecurityCode = "FG2T5";
MyEmailExchange->Activate();
Returns true if the user is logged in, otherwise returns false.
Logs out the user from mod.io.
- Process and initialization
- User authentication
- Browsing
- Subscriptions
- Listeners
- Schemas
- Delegates