-
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. |
Modio->EmailRequest("[email protected]", FModioGenericDelegate::CreateUObject(ModioManager, &UModioManager::OnEmailRequest));
// ...
void UModioManager::OnEmailRequest(FModioResponse Response)
{
// Response.code should be 200 if an security code was sent to the provided email
}
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. |
Modio->EmailExchange("VBY5A", FModioGenericDelegate::CreateUObject(ModioManager, &UModioManager::OnEmailExchange));
// ...
void UModioManager::OnEmailExchange(FModioResponse Response)
{
// Response.code should be 200 if you are now authenticated
}
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