The Auth module is located at
modules/EVSE/Auth/ and provides the auth and reservation interfaces.Overview
The Auth module acts as the authorization coordinator:- Token Collection: Aggregates tokens from multiple providers (RFID, OCPP, Autocharge, PnC)
- Token Validation: Validates tokens through multiple validators (OCPP, local lists)
- Connector Selection: Intelligently assigns tokens to available connectors
- Reservation Management: Handles reservation requests and matching
- Transaction Tracking: Monitors charging sessions and authorization states
Multi-Source Auth
Collect tokens from RFID, OCPP, Autocharge, and Plug & Charge
Flexible Validation
Validate against OCPP CSMS, local lists, or custom validators
Smart Selection
Intelligent connector assignment algorithms
Reservations
Full reservation lifecycle management
Module Configuration
Connector Selection Algorithm
Logic for selecting a connector for an incoming token:
- PlugEvents: Select based on EV plug-in events
- FindFirst: Select first available connector without active transaction
- UserInput: Reserved for future manual connector selection feature
For single-connector stations, selection is straightforward. For multi-connector stations, this becomes critical.
Authorization Timeouts
Timeout in seconds for authorization validity:
- How long an authorization remains valid before being discarded
- How long after plug-in the user must provide authorization
Typical values: 60-300 seconds depending on user workflow.
Enable plug-in timeout for multi-EVSE installationsWhen enabled:
- Timer starts immediately when EV is detected
- User must present token within
connection_timeout - Prevents ambiguous authorization assignments
Useful for charging stations with multiple EVSEs and a shared RFID reader.
Master Pass Configuration
Group ID for master pass tokensMaster pass tokens:
- Can stop ANY ongoing transaction
- Cannot start new transactions
- Useful for law enforcement, towing, emergency access
Token Handling Behavior
Controls parent_id_token behavior:If true:
- New token is preferably used for authorizing available connectors
- Only used to stop transaction if no connector available
- Token first attempts to stop any transaction with matching parent_id_token
- Only authorizes new connector if no matching transaction
true is better for public charging (prioritize new customers).
false is better for private/fleet charging (same card stops session).Fault Handling
Control whether faulty connectors can be authorized:If true:
- Faults are ignored, authorization proceeds
- Charging starts when fault clears
- Useful for free charging, home use cases
- Faulty connectors cannot be authorized
- Requires re-plug after fault clears
- Recommended for public charging
Module Interfaces
Provided Interfaces
main (auth)
main (auth)
Main authentication interface for EVerestCommands:
set_connection_timeout()- Update timeout dynamicallyset_master_pass_group_id()- Configure master passset_prioritize_authorization_over_stopping_transaction()- Update behavior
- Published authorization events
- Transaction state updates
reservation (reservation)
reservation (reservation)
Reservation management interfaceCommands:
make_reservation()- Create new reservationcancel_reservation()- Cancel existing reservation
- Reservation matching on authorization
- Reservation expiry
- Connector availability with reservations
Required Interfaces
token_provider (auth_token_provider)
token_provider (auth_token_provider)
Required: 1-128 connectionsProvides authorization tokens from various sources:
- RFID/NFC readers
- OCPP remote start requests
- Autocharge (MAC address)
- Plug & Charge (contract certificates)
Connect all token sources to Auth module.
token_validator (auth_token_validator)
token_validator (auth_token_validator)
Required: 1-128 connectionsValidates tokens through various methods:
- OCPP authorization (RemoteStartTransaction, IdTagInfo)
- Local authorization lists
- Custom validation logic
Multiple validators can be connected. Auth module aggregates results.
evse_manager (evse_manager)
evse_manager (evse_manager)
Required: 1-128 connectionsConnects to EvseManager instances representing physical connectors.Auth module:
- Monitors connector states
- Assigns authorizations to connectors
- Tracks transaction lifecycle
kvs (kvs)
kvs (kvs)
Optional: 0-1 connectionKey-value store for persistent data:
- Reservation storage
- Transaction state across reboots
Configuration Examples
Single Connector with RFID
Multi-Connector with OCPP
With Master Pass and Reservations
Authorization Flow
Normal Authorization
Plug Events Algorithm
FindFirst Algorithm
Reservation Management
The Auth module implements thereservation interface:
Creating Reservations
Reservation Matching
When a token is presented:- Auth checks if token matches a reservation
- If matched, authorization is prioritized
- Connector selection respects reservation
- Reservation is consumed (or remains until expiry)
Reservation Expiry
Reservations expire automatically:- At configured expiry time
- When consumed by matching authorization
- When explicitly cancelled
Reservations are persisted if
kvs interface is connected.Token Provider Integration
RFID Reader
OCPP Remote Start
Autocharge (MAC Address)
Plug & Charge
Token Validator Integration
OCPP Validation
Local Whitelist
Multiple Validators
Transaction Lifecycle
Transaction States
- No Transaction: Connector idle
- Authorization Pending: Token presented, waiting for validation
- Authorized: Token validated, waiting for plug-in or energy
- Transaction Active: Charging in progress
- Transaction Finishing: Stop requested, finalizing
- Transaction Finished: Complete, waiting for unplug
Stopping Transactions
Methods:- Present same token again (if parent_id matching enabled)
- OCPP RemoteStopTransaction
- Master pass token
- Emergency stop
- Fault condition
Advanced Features
Parent ID Token Matching
Tokens can have parent relationships:prioritize_authorization_over_stopping_transaction.
Authorization Types
- RFID: Physical card/fob
- Autocharge: MAC address-based
- PlugAndCharge: ISO 15118 contract certificate
- BankCard: Payment card (future)
- Central: Backend authorization
Troubleshooting
Authorization Not Working
Authorization Not Working
Wrong Connector Selected
Wrong Connector Selected
- For physical selection: Use
PlugEventsalgorithm - For automatic selection: Use
FindFirst - Verify plug-in events are being reported by EvseManager
- Check connector states and availability
Reservation Not Matching
Reservation Not Matching
- Verify reservation ID token exactly matches provided token
- Check reservation hasn’t expired
- Ensure kvs module connected for persistence
- Review connector_type matching
OCPP Authorization Fails
OCPP Authorization Fails
Best Practices
Timeout Configuration: Set
connection_timeout based on your user workflow. Public charging: 60-120s. Private/fleet: 300-600s.Algorithm Selection: Use
PlugEvents for multi-connector installations where users can freely choose. Use FindFirst for managed installations.Persistent Storage: Always connect
kvs interface in production to persist reservations and transaction state across reboots.Related Modules
EvseManager
Receives authorizations and manages charging
OCPP
Token provider and validator for CSMS
Hardware Drivers
NFC/RFID readers for token input
ISO 15118
Plug & Charge token provider
Source Code Reference
modules/EVSE/Auth/Auth.cpp- Main implementation (7.5KB)modules/EVSE/Auth/manifest.yaml- Module configurationmodules/EVSE/Auth/reservation/- Reservation handlinginterfaces/auth.yaml- Auth interface definitioninterfaces/auth_token_provider.yaml- Token provider interfaceinterfaces/auth_token_validator.yaml- Token validator interface