-
Notifications
You must be signed in to change notification settings - Fork 27
External Auth
void Instance::galaxyAuth(const std::string &appdata, bool terms_agreed, const std::function<void(const modio::Response &)> &callback)
API endpoint used: Authenticate via GOG Galaxy
Request an access token on behalf of a GOG Galaxy user. To use this functionality you must supply your games encrypted app ticket key supplied by GOG Galaxy, in the Edit > Options page of your games profile on mod.io. Additionally you have to retrieve the appdata from the Galaxy SDK.
Name | Type | Description |
---|---|---|
appdata | const std::string& |
The GOG Galaxy users Encrypted App Ticket provided by the GOG Galaxy SDK. |
terms_agreed | bool |
This MUST be set to false unless you have collected the users agreement prior to calling this endpoint in which case it can be set to true and will be recorded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.galaxyAuth(appdata, terms_agreed, [&](const modio::Response &response)
{
if (response.code == 200)
{
//Successful Galaxy authentication
}
});
void Instance::oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, u32 date_expires, bool terms_agreed, const std::function<void(const modio::Response &)> &callback);
API endpoint used: Authenticate via GOG Galaxy
Request an access token on behalf of an Oculus user. To use this functionality you must supply your games encrypted app ticket key supplied by GOG Galaxy, in the Edit > Options page of your games profile on mod.io. Additionally you have to retrieve the nonce, user id and token from the Oculus SDK.
Name | Type | Description |
---|---|---|
nonce | const std::string& |
The nonce provided by calling ovr_User_GetUserProof() from the Oculus SDK. |
oculus_user_id | const std::string& |
The user's Oculus id providing by calling ovr_GetLoggedInUserID() from the Oculus SDK. |
access_token | const std::string& |
The user's access token, providing by calling ovr_User_GetAccessToken() from the Oculus SDK. mod.io uses this access token on the first login only to obtain the user's username and is not saved on our servers. |
const std::string& |
The users email address. This is recommended but optional. | |
date_expires | u32 |
Unix timestamp of date in which the returned token will expire. |
terms_agreed | bool |
This MUST be set to false unless you have collected the users agreement prior to calling this endpoint in which case it can be set to true and will be recorded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.oculusAuth(nonce, oculus_user_id, access_token, email, date_expires, terms_agreed, [&](const modio::Response &response) {
if (response.code == 200)
{
//Successful Oculus authentication
}
});
void Instance::steamAuth(const unsigned char* rgubTicket, u32 cubTicket, terms_agreed, const std::function<void(const modio::Response &)> &callback)
API endpoint used: Authenticate via Steam
Request an access token on behalf of a Steam user. To use this functionality you must supply your games encrypted app ticket key supplied by Steamworks, in the Edit > Options page of your games profile on mod.io. Additionally connect to the Steamworks SDK to retrieve an authentication ticket.
Name | Type | Description |
---|---|---|
rgubTicket | const unsigned char* |
The Steam Encrypted App Ticket provided by the Steamworks SDK. |
cubTicket | u32 |
The Steam Encrypted App Ticket size provided by the Steamworks SDK. |
terms_agreed | bool |
This MUST be set to false unless you have collected the users agreement prior to calling this endpoint in which case it can be set to true and will be recorded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.steamAuth(rgubTicket, cubTicket, terms_agreed, [&](const modio::Response &response)
{
if (response.code == 200)
{
//Successful Steam authentication
}
});
void Instance::steamAuth(const std::string &base64_token, bool terms_agreed, const std::function<void(const modio::Response &)> &callback)
API endpoint used: Authenticate via Steam
Request an access token on behalf of a Steam user. To use this functionality you must supply your games encrypted app ticket key supplied by Steamworks, in the Edit > Options page of your games profile on mod.io. Additionally connect to the Steamworks SDK to retrieve an authentication ticket.
Name | Type | Description |
---|---|---|
base64_token | const unsigned char* |
The Steam Encrypted App Ticket provided by the Steamworks SDK and encrypted on base 64 format. |
terms_agreed | bool |
This MUST be set to false unless you have collected the users agreement prior to calling this endpoint in which case it can be set to true and will be recorded. |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.steamAuth(base64_token, terms_agreed, [&](const modio::Response &response)
{
if (response.code == 200)
{
//Successful Steam authentication
}
});
void Instance::linkExternalAccount(u32 service, const std::string &service_id, const std::string &email, const std::function<void(const modio::Response &)> &callback)
API endpoint used: Link External Account
Connect an external account (i.e. Steam and GOG documented above) with the authenticated user's e-mail address. When calling this endpoint you must provide authenticated user's ID of their external account. If we have a matching external account saved for that user, a Successful request will which means the user will have to check the supplied e-mail address to link the external account to the respective e-mail address.
Name | Type | Description |
---|---|---|
service | u32 |
The ExternalService constant where the user's account originates. |
service_id | std::string |
The external service user id. |
std::string |
The e-mail address to link to the authenticated user's account. | |
callback | const std::function<void(const modio::Response&)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.linkExternalAccount(MODIO_SERVICE_STEAM, "76561198071708793", "john@doe.com", [&](const modio::Response &response)
{
if (response.code == 200)
{
//Account linked successfully
}
});
- Home
- Table of Contents
- Getting Started
- SDK Methods
- Creators
- Editors
- Schemas
- modio::Avatar
- modio::Comment
- modio::Dependency
- modio::Download
- modio::Error
- modio::Filehash
- modio::Game
- modio::GameTagOption
- modio::Header
- modio::Icon
- modio::Image
- modio::InstalledMod
- modio::Logo
- modio::Media
- modio::MetadataKVP
- modio::Mod
- modio::ModEvent
- modio::Modfile
- modio::QueuedModDownload
- modio::QueuedModfileUpload
- modio::Rating
- modio::Response
- modio::Stats
- modio::Tag
- modio::User
- Debugging
- Constants
-
C Compatibility
- Methods
- Initialization, Process and Shutdown (C compatible)
- User Authentication (C compatible)
- Mods (C compatible)
- Modfiles (C compatible)
- Media (C compatible)
- Subscriptions (C compatible)
- Events (C compatible)
- Stats (C compatible)
- Tags (C compatible)
- Ratings (C compatible)
- Metadata KVP (C compatible)
- Dependencies (C compatible)
- Comments (C compatible)
- Reports (C compatible)
- Me (C compatible)
- Downloads (C compatible)
- Uploads (C compatible)
- Logs (C compatible)
- External Auth (C compatible)
- Configuration (C compatible)
- Creators
- Editors
- Schemas
- ModioAvatar
- ModioComment
- ModioDependency
- ModioDownload
- ModioError
- ModioFilehash
- ModioGame
- ModioGameTagOption
- ModioHeader
- ModioIcon
- ModioImage
- ModioInstalledMod
- ModioListNode
- ModioLogo
- ModioMedia
- ModioMetadataKVP
- ModioMod
- ModioModEvent
- ModioModfile
- ModioQueuedModDownload
- ModioQueuedModfileUpload
- ModioRating
- ModioResponse
- ModioStats
- ModioTag
- ModioUser
- Methods
- Building