Explanations use OCPI 2.2.1. Physical and billing-system events are authored examples.
Part of the lesson OCPI charging session lifecycle
CPO and eMSP exchange credentials
Technical
3 min
CPO and eMSP exchange credentialsExplore the credentials module →
Still using token A, the eMSP POSTs CREDENTIALS_TOKEN_B to the credentials endpoint it found in the version details. The CPO stores token B for its own requests to the eMSP and returns CREDENTIALS_TOKEN_C. Each token works in one direction: B for the CPO calling the eMSP, C for the eMSP calling the CPO.
No sandbox run sends this exchange, so there is nothing to run here.
EMSP
CPO
"The Sender starts the registration process, retrieves the version information and details (using `CREDENTIALS_TOKEN_A` in the HTTP Authorization header). The Sender generates a unique credentials token: `CREDENTIALS_TOKEN_B`, sends it to the Receiver in a POST request to the `credentials` module of the Receiver. The Receiver stores `CREDENTIALS_TOKEN_B` and uses it for any requests to the Sender Platform, including the version information and details. The Receiver generates a unique credentials token: `CREDENTIALS_TOKEN_C` and returns it to the Sender in the response to the POST request from the Sender."OCPI 2.2.1 Credentials chapter · #credentials_registration"After the credentials exchange has finished, the Sender SHALL use `CREDENTIALS_TOKEN_C` in future OCPI request to the Receiver Platform."OCPI 2.2.1 Credentials chapter · #credentials_registration"|token |string(64) |1 |The credentials token for the other party to authenticate in your system. It should only contain printable non-whitespace ASCII characters, that is, characters with Unicode code points from the range of U+0021 up to and including U+007E. |url |URL |1 |The URL to your API versions endpoint. |roles |CredentialsRole |+ |List of the roles this party provides."OCPI 2.2.1 Credentials chapter · #credentials_credentials_object"After the literal 'Token', there SHALL be one space, followed by the 'encoded token'. The encoded token is obtained by encoding the credentials token to an octet sequence with UTF-8 and then encoding that octet sequence with Base64 according to https://datatracker.ietf.org/doc/html/rfc4648#section-4[RFC 4648]."OCPI 2.2.1 Transport and format chapter · #transport_and_format_authorization_header
Message FlowStep 2 of 4