MergeEpicGamesIdentity
Merge the profile associated with the provided Epic Games credentials with the current profile.
NOTE: If using the BrainCloudWrapper, once the merge is complete you should call SetStoredProfileId in the BrainCloudWrapper with the profileId returned in the Merge call.
| Service | Operation |
|---|---|
| identity | MERGE |
note
Epic Games support was added to the C# (Unity) client library first. Check the release notes of your client library to confirm it is available on your platform.
Method Parameters
| Parameter | Description |
|---|---|
| epicAccountId | LocalUserId.ToString() retrieved from the EOS SDK Auth Interface's Login method. This is the Epic Account ID that will be attached to the user's profile, and it must match the sub claim of authIdToken. |
| authIdToken | The ID token JWT (IdToken.Value.JsonWebToken) retrieved from the EOS SDK Auth Interface's CopyIdToken method. It is validated by the brainCloud server. |
Usage
http://localhost:3000
- C#
- C++
- Obj-C
- Java
- JavaScript
- Dart
- Roblox
- GDScript
- Lua
- Cloud Code
- Raw
string epicAccountId = "0123456789abcdef0123456789abcdef";
string authIdToken = "idTokenFromEOS";
_bc.IdentityService.MergeEpicGamesIdentity(
epicAccountId,
authIdToken,
SuccessCallback, FailureCallback);
const char* epicAccountId = "0123456789abcdef0123456789abcdef";
const char* authIdToken = "idTokenFromEOS";
_bc->getIdentityService()->mergeEpicGamesIdentity(
epicAccountId, authIdToken, this);
NSString * epicAccountId = @"0123456789abcdef0123456789abcdef";
NSString * authIdToken = @"idTokenFromEOS";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc identityService]
mergeEpicGamesIdentity:epicAccountId
authIdToken:authIdToken
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String epicAccountId = "0123456789abcdef0123456789abcdef";
String authIdToken = "idTokenFromEOS";
this; // implements IServerCallback
_bc.getIdentityService().mergeEpicGamesIdentity(epicAccountId, authIdToken, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var epicAccountId = "0123456789abcdef0123456789abcdef";
var authIdToken = "idTokenFromEOS";
_bc.identity.mergeEpicGamesIdentity(epicAccountId, authIdToken, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var epicAccountId = "0123456789abcdef0123456789abcdef";
var authIdToken = "idTokenFromEOS";
ServerResponse result = await _bc.identityService.mergeEpicGamesIdentity(epicAccountId:epicAccountId, authIdToken:authIdToken);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
local epicAccountId = "0123456789abcdef0123456789abcdef"
local authIdToken = "idTokenFromEOS"
local callback = function(success, response)
if success then
print("Success")
else
print("Failed | " .. tostring(response.status_message))
end
end
_bc.identity:mergeEpicGamesIdentity(epicAccountId, authIdToken, callback)
var epic_account_id = "0123456789abcdef0123456789abcdef"
var auth_id_token = "idTokenFromEOS"
var result = await _bc.identity_service.merge_epic_games_identity(epic_account_id, auth_id_token)
if result.status == 200:
print("Success")
else:
print("Failed: %s" % result.status_message)
local epicAccountId = "0123456789abcdef0123456789abcdef"
local authIdToken = "idTokenFromEOS"
local callback = function(success, response)
if success then
print("Success")
else
print("Failed | " .. tostring(response.status_message))
end
end
_bc.identity:mergeEpicGamesIdentity(epicAccountId, authIdToken, callback)
// N/A
{
"service": "identity",
"operation": "MERGE",
"data": {
"externalId": "0123456789abcdef0123456789abcdef",
"authenticationToken": "idTokenFromEOS",
"authenticationType": "EpicGames"
}
}
JSON Response
{
"data": {
"profileId": "f94f7e2d-3cdd-4fd6-9c28-392f7875e9df"
},
"status": 200
}
Common Error Code
Status Codes
| Code | Name | Description |
|---|---|---|
| 40211 | DUPLICATE_IDENTITY_TYPE | Returned when trying to attach an identity type that already exists for that profile. For instance you can have only one Epic Games identity for a profile. |