Is It Possible to Use GameKit Identity and Authentication with Steam, Epic Accounts, Xbox and ...?

0

I am developing a game for PC and Consoles and don't players be forced to provide Email and Password for using the game; It seems to me GameKit only allow Email/Password login or Facebook login. However this is not very desirable for me and the players as they prefer to login to the game services with their corresponding platform identities (Steam and Epic accounts for PC, Xbox account for Xbox Console and ...). Other BaaS solutions for games like PlayFab and Epic Online Services have such a functionality.

Now I am wondering if I am missing something here and there is a solution for doing what I want to do or GameKit does not provide such functionality (which would be a great drawback to me)?

Aydin
asked 2 years ago291 views
1 Answer
0

Set up Additional Federated Identity Providers

There are 2 ways to add identity providers

  • Setup Custom Authorizer
  • Add Additional Federated providers like Facebook

Setup Custom Authorizer

https://docs.aws.amazon.com/gamekit/latest/UnityDevGuide/launch-readiness.html#launch-readiness-cfn-authorizer In this approach you can provide only one Identity provider. This will also disable the provided cognito identity provider. (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/cloudformation/identity/parameters.yml#L61)

Apple jwks url can be found at: https://developer.apple.com/documentation/sign_in_with_apple/fetch_apple_s_public_key_for_verifying_token_signature .

Add Additional Federated providers like Facebook

Kindly make the following changes to add additional federated identity providers to gamekit. Note that the identity provider should be supported by Aws Cognito https://docs.aws.amazon.com/cognito/latest/developerguide/getting-started-with-identity-pools.html (see Integrate the identity providers section)

aws-gamekit (https://github.com/aws/aws-gamekit):

  1. Extend IFederatedIdentityProvider (https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/include/aws/gamekit/identity/federated_identity_provider.h) like FacebookIdentityProvider (https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/include/aws/gamekit/identity/facebook_identity_provider.h) does. For example, create a GoogleIdentityProvider class.
  2. Add the new provider to the FederatedIdentityProvider enum (https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-core/include/aws/gamekit/core/enums.h#L17) if it's not already present.
  3. Call the new provider's methods in these IF blocks:
    1. https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/source/aws/gamekit/identity/exports.cpp#L77
    2. https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/source/aws/gamekit/identity/exports.cpp#L91
    3. https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/source/aws/gamekit/identity/exports.cpp#L109

aws-gamekit-unity (https://github.com/aws/aws-gamekit-unity):

  1. Create a new AWS Lambda function for each of the web requests made by the new IFederatedIdentityProvider. Use the Facebook Lambda functions as a guide:
    1. https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]eTemplates/functions/identity/CognitoFbCallbackHandler/index.py (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/functions/identity/CognitoFbCallbackHandler/index.py)
    2. https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]eTemplates/functions/identity/GenerateFacebookLoginUrl/index.py (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/functions/identity/GenerateFacebookLoginUrl/index.py)
    3. https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]mplates/functions/identity/PollFacebookLoginCompletion/index.py (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/functions/identity/PollFacebookLoginCompletion/index.py)
    4. https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]aseTemplates/functions/identity/RetrieveFacebookTokens/index.py (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/functions/identity/RetrieveFacebookTokens/index.py)
  2. Add the new provider to the DyanmoDB table:
    1. Add a new attribute (ex: google_external_id): https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]urces/.BaseTemplates/cloudformation/identity/cloudFormation.yml (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/cloudformation/identity/cloudFormation.yml#L116)
    2. Add this attribute as a desired field here: https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]urces/.BaseTemplates/functions/identity/CognitoGetUser/index.py (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/functions/identity/CognitoGetUser/index.py#L24)
    3. Add a new global secondary index (ex: gidx_facebook_external_id): https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]urces/.BaseTemplates/cloudformation/identity/cloudFormation.yml (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/cloudformation/identity/cloudFormation.yml#L129)
  3. Add your new provider as a desired field here (ex: google_external_id): https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/[…]urces/.BaseTemplates/functions/identity/CognitoGetUser/index.py (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/functions/identity/CognitoGetUser/index.py#L23)
  4. Update the cloudformation.yml, parameters.yml, and optionally dashboard.yml (https://github.com/aws/aws-gamekit-unity/tree/main/Packages/com.amazonaws.gamekit/Editor/CloudResources/.BaseTemplates/cloudformation/identity) to enable creation of the new lambda functions. Use the Facebook-related yaml as reference (search these three files for facebook and fb to find it).
  5. IdentityandAuthenticationSettingsTab (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Editor/Scripts/Windows/Settings/Pages/IdentityAndAuthentication/IdentityAndAuthenticationSettingsTab.cs) needs to be updated to be able to select and deploy the authentication provider when deploying identity&Authentication feature
  6. Add the new identity provider to the FederatedIdentityProvider enum (https://github.com/aws/aws-gamekit-unity/blob/main/Packages/com.amazonaws.gamekit/Runtime/Scripts/Features/Identity/IdentityModels.cs#L10 (https://github.com/aws/aws-gamekit-unity/blob/1d3ab6102417dbb5e155c7d302516e1329d8148c/Packages/com.amazonaws.gamekit/Runtime/Scripts/Features/Identity/IdentityModels.cs#L10). It's integer value must match the value that was added in step 2 of the aws-gamekit instructions. (i.e. this line: https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-core/include/aws/gamekit/core/enums.h#L17
AWS
imdasor
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions