- Newest
- Most votes
- Most comments
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):
- 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.
- 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.
- Call the new provider's methods in these IF blocks:
- https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/source/aws/gamekit/identity/exports.cpp#L77
- https://github.com/aws/aws-gamekit/blob/main/aws-gamekit-identity/source/aws/gamekit/identity/exports.cpp#L91
- 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):
- 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:
- 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)
- 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)
- 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)
- 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)
- Add the new provider to the DyanmoDB table:
- 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)
- 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)
- 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)
- 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)
- 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).
- 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
- 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
Relevant content
- asked 6 years ago
- Accepted Answerasked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago