Authentication
Advanced Topics
Configuration

Setup credentials

Login to ROQ Console (opens in a new tab), copy the needed credentials and paste them into the .env file of your web application. You need to add the ROQ_SECRET variable. The value can be generated by running openssl rand -hex 32 on the command line.

Public variables, used on client-side

VariableDescription
NEXT_PUBLIC_ROQ_CLIENT_IDIdentifies the client on the client-side
NEXT_PUBLIC_ROQ_PLATFORM_URLInstance of ROQ Platform to which this environment is connected
NEXT_PUBLIC_BASE_URLApplication base URL

Server variables used for ROQ connection

VariableDescription
ROQ_BASE_URLApplication base URL
ROQ_PLATFORM_URLInstance of ROQ Platform to which this environment is connected
ROQ_ENVIRONMENT_IDIdentifier of the environment, like "production- or staging-environment"
ROQ_API_KEYThe ROQ API key secures the server-side interaction between your application and ROQ Platform. Keep confidential and don't exose it to the client-side.

Server variables for ROQ auth

VariableDescription
ROQ_SECRETThe secret key is used to sign the JWT tokens for the session. You need to generate this key yourself using openssl rand -hex 32 on the command line.
ROQ_CLIENT_IDIdentifies the client on the server-side
ROQ_AUTH_CALLBACK_URLHandles callbacks from the hosted login page after successful authentication.
ROQ_AUTH_LOGIN_URLPerforms a secure redirect to the managed login and registration page
ROQ_AUTH_LOGOUT_URLClears the session tokens.
ROQ_AUTH_URLThe URL of the managed login and registration page. This URL can be customized.

Additional configuration

The following parameters are optional and can be used for further adjustments:

Config variableDescriptionExample
ROQ_SESSION_MAX_AGEMaximum time (seconds) of an active session. Default: 30 days86400 (1 day)
ROQ_SESSION_INACTIVITY_TIMEOUTMaximum time (seconds) of allowed inactivity. Default: 24 hours43200 (12 hours)