This is a sample Flask Web App for capturing a selfie using the webcam and perform face authentication using YooniK APIs.
It handles the YooniK's redirect Action in Auth0.
- You can start by installing the YooniK Face Authentication Action in your Auth0 account. Please follow the instructions here.
- Then, in Auth0 dashboard click the Actions > Flows tab.
- Select the Login flow.
- Move your newly installed YooniK Action to your login flow.
- Click on the YooniK Action box and then on View Settings.
- Fill the YooniK Application URL with the URL for this sample app (e.g. http://127.0.0.1:3031); and the YooniK Session Secret with a random long string.
$ git clone https://github.com/dev-yoonik/YK-Authentication-SDK-Python.git
$ cd YK-Authentication-SDK-Python
$ pip install -r requirements.txt
Copy the client_secrets.json.dist
to client_secrets.json
:
$ cp client_secrets.json.dist client_secrets.json
You now need to set the configuration values in the client_secrets.json
file.
{
"YOONIK_SESSION_SECRET": "{{A random long string that is used to sign the session token from Auth0}}",
"YOONIK_AUTHENTICATION_API_URL": "{{URL for YooniK Authentication APIs}}",
"YOONIK_AUTHENTICATION_API_KEY": "{{Your YooniK API key for accessing the YooniK APIs (please contact support@yoonik.me).}}",
"APP_SECRET": "{{A random long string that is used as secret key to this flask app}}"
}
The YOONIK_SESSION_SECRET is the string you set before in the Auth0 action configuration.
Run the app:
$ python app.py
The app should be listening on http://localhost:3031!
You can find additional code samples here:
- delete_user.py: Use YooniK Authentication API to delete all data related to a user.
You can use the provided Dockerfile to build a docker image with this sample app.
For a complete specification of our Authentication API please check this swagger file.
For more information, support and trial licenses please contact us or join us at our discord community.