Skip to main content

NoAuth

Introduction

NoAuth mode is a simple way to define an unauthenticated access for anonymous users. This is useful for testing or development purposes or to run your API endpoints as fully public without any authentication.

Production Warning

Using NoAuth mode in production environments is not advisable unless you intend for your API to be completely public. If your API contains any sensitive data, you should enable authentication and avoid using NoAuth mode in production.

Enabling NoAuth Mode

Only one NoAuth is configured.

There must be only one noAuth mode in the array. RelyAuth will fail to start if there are many configured NoAuth modes.

Configuration

Edit the auth.yaml file. Add an noAuth mode to the end of the definitions array.

An example for noAuth mode:
version: v1
kind: RelyAuth
definition:
modes:
- mode: noAuth
sessionVariables:
x-hasura-role:
value: anonymous

sessionVariables

Static session variables that will be used if authenticated, such as x-hasura-role: anonymous. This field is a key-value map, with value can be either a literal value or an environment variable.