Cognity is a middleware to authenticate users with Cognito in the popular Unity game engine.
AWS provides a basic set of client libraries for Unity, but officially only supports those libraries in Mobile builds of Unity. Thus this library, which is independent of deployment platform.
The library contains basic code implementation of interacting with basic principles of user management.
- Registration
- Email confirmation
- Sign in and token refresh
- Recover password
- Basic profile settings
- Local storage of authentication between sessions
There is also a very basic UI demonstrating all the functions.
The code is written in clear C#. The demo application should open and run without issues on any recent Unity version that supports .Net Standard 2.0. It uses IObserver/IObservable to execute non-blocking web requests.
The library uses Newtonsoft for configuration only for convenience and as example.
There is a backend IaC stack in terraform contained in the Backend/
folder. This can be used to deploy a complete Cognito User Pool and Identity Pool. Use terraform out -json > ../Assets/cognity.json
command to generate the configuration file for Unity.