-
Notifications
You must be signed in to change notification settings - Fork 27
External Auth (C compatible)
void modioGalaxyAuth(void* object, char* appdata, bool terms_agreed, void (*callback)(void* object, ModioResponse response))
API endpoint used: Authenticate via GOG Galaxy
C++ wrapper: External Auth#galaxyauth
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 |
---|---|---|
object | void* |
Context parameter. |
appdata | char* |
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 | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | ModioResponse |
ModioResponse object that contains the mod.io response status |
void onGalaxyAuth(void *object, ModioResponse response)
{
if (response.code == 200)
{
// Successful Galaxy authentication
}
}
[...]
modioGalaxyAuth(NULL, "GALAXY APPDATA HERE", terms_agreed, &onGalaxyAuth);
void modioOculusAuth(void* object, char const* nonce, char const* oculus_user_id, char const* access_token, char const* email, u32 date_expires, bool terms_agreed, void (*callback)(void* object, ModioResponse response));
API endpoint used: Authenticate via Oculus
C++ wrapper: External Auth#oculusauth
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 |
---|---|---|
object | void* |
Context parameter. |
nonce | char const* |
The nonce provided by calling ovr_User_GetUserProof() from the Oculus SDK. |
oculus_user_id | char const* |
The user's Oculus id providing by calling ovr_GetLoggedInUserID() from the Oculus SDK. |
access_token | char const* |
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. |
char const* |
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 | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | ModioResponse |
ModioResponse object that contains the mod.io response status |
void onOculusAuth(void *object, ModioResponse response)
{
if (response.code == 200)
{
// Successful Oculus authentication
}
}
[...]
modioOculusAuth(&wait, nonce, oculus_user_id, access_token, email, date_expires, terms_agreed, &onOculusAuth);
void modioSteamAuth(void* object, unsigned char* rgubTicket, u32 cubTicket, bool terms_agreed, void (*callback)(void* object, ModioResponse response))
API endpoint used: Authenticate via Steam
C++ wrapper: External Auth#steamauth
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.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
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 | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | ModioResponse |
ModioResponse object that contains the mod.io response status |
void onSteamAuth(void *object, ModioResponse response)
{
if (response.code == 200)
{
// Successful Steam authentication
}
}
[...]
modioSteamAuth(NULL, rgubTicket, cubTicket, terms_agreed, &onSteamAuth);
void modioSteamAuthEncoded(void* object, char const* base64_ticket, bool terms_agreed, void (*callback)(void* object, ModioResponse response))
API endpoint used: Authenticate via Steam
C++ wrapper: External Auth#steamauthencoded
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 |
---|---|---|
object | void* |
Context parameter. |
base64_ticket | char const* |
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 | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | ModioResponse |
ModioResponse object that contains the mod.io response status |
void onSteamAuth(void *object, ModioResponse response)
{
if (response.code == 200)
{
// Successful Steam authentication
}
}
[...]
modioSteamAuthEncoded(NULL, base64_ticket, terms_agreed, &onSteamAuth);
void modioLinkExternalAccount(void* object, u32 service, char* service_id, char* email, void (*callback)(void* object, ModioResponse response))
API endpoint used: Link External Account
C++ wrapper: External Auth#linkexternalaccount
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 |
---|---|---|
object | void* |
Context parameter. |
service | u32 |
The ExternalService constant where the user's account originates. |
service_id | char* |
The external service user id. |
char* |
The e-mail address to link to the authenticated user's account. | |
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 | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | ModioResponse |
ModioResponse object that contains the mod.io response status |
void onLinkExternalAccount(void *object, ModioResponse response)
{
if (response.code == 200)
{
// Account linked successfully
}
}
[...]
modioLinkExternalAccount(NULL, MODIO_SERVICE_STEAM, "76561198071708793", "john@doe.com", &onLinkExternalAccount);
- 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