Authentication with an email address
EMAIL_SIGN_UP is designed for players to register for an account with an email address and use that email address and a password to log in.
Configuration
Be sure to configure the Catena platform auth service when using this validator.
The ConnectionString used by the EMAIL_SIGN_UP validator must match the ConnectionString used by the Catena platform auth service for players to sign up and authenticate.
To use the email sign up provider with the Catena authentication service, make sure it is enabled in the configuration and the database ConnectionString is configured.
{
"Catena": {
"Authentication": {
"PROVIDER_EMAIL_SIGN_UP": {
"ConnectionString": "Data Source=Build/SqliteDatabase/email_sign_up.db;Foreign Keys=True",
"IsEnabled": true
}
}
}
}Usage
To authenticate with a registered email address, specify EMAIL_SIGN_UP in your authentication request and the email address and password separated by a colon as the payload, for example: address@mail.local:password.
Refer to the following code samples.
Note: A successful authentication request will return an empty response body. The catena-session-id response header is what we're looking for here.
Code Sample
- Localhost http://localhost:5000/api/v1/authentication/login
- Custom Domain https://your_domain_here/api/v1/authentication/login
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
http://localhost:5000/api/v1/authentication/login \
-H 'Content-Type: application/json' \
-d '{
"provider": "PROVIDER_EMAIL_SIGN_UP",
"payload": "address@mail.local:password"
}'{ "redirectUri": "string" }