The authentication and user-management service of Payment Hub EE: it issues the tokens every other Payment Hub EE component checks, and it owns the users, roles and permissions behind them.
- Issues access and refresh tokens at
POST /oauth/token. Tokens are RSA-signed JWTs, valid for 10 minutes; a refresh token lasts 12 hours. - Publishes the public half of the signing key at
GET /oauth/token_key, so other services can verify a token without calling back here, and answersPOST /oauth/check_tokenfor callers that would rather ask. - Manages users, roles and permissions under
/api/v1—/users,/roles,/permissionsand the calls that attach roles to a user or permissions to a role. - Serves read-only views of workflow data under the same prefix:
/transactions,/transaction/{workflowInstanceKey},/tasksand/variables. - Keeps each tenant's data in its own database, and runs the Flyway migrations for every tenant it finds at startup.
Every request that reaches Payment Hub EE from outside arrives with a bearer token, and this is the
service that issued it. The web consoles sign in here; the other components verify the token with
the public key published at /oauth/token_key rather than calling this service on each request, so
it is not on the hot path of a payment. It was previously called ph-ee-identity-provider.
Payment Hub EE is multi-tenant, and this service is where that starts. Every call except
/oauth/token_key has to say which tenant it is for, in the Platform-TenantId header or a
tenantIdentifier query parameter. A request with no tenant is rejected before authentication
runs, because the tenant decides which database the user is looked up in.
- Java 21
- Spring Boot 3.4 (Web, Security, OAuth2 resource server, Cache, Data JPA)
- EclipseLink as the JPA provider, not Hibernate
- MySQL, with one datasource per tenant and Flyway for migrations
- Jakarta EE 10
- Gradle build; versions come from
paymenthub-ee-bom
./gradlew clean build # compiles and runs the tests
./gradlew bootRun # runs the service locally
docker build -t paymenthub-ee-auth .
The service listens on port 5000. It needs a MySQL instance holding a tenants schema that lists
the tenants and, for each one, how to reach its database. The defaults in
src/main/resources/application.properties point at a host named operations-mysql, which is the
service name inside a Payment Hub EE deployment; override them for a local run:
fineract.datasource.core.host # MySQL host, default operations-mysql
fineract.datasource.core.port # default 3306
fineract.datasource.core.schema # schema holding the tenant list, default tenants
fineract.datasource.core.username
fineract.datasource.core.password
Spring's relaxed binding means each of these can also be set as an environment variable, for
example FINERACT_DATASOURCE_CORE_HOST.
Tokens are signed with the RSA key pair in src/main/resources (jwt.pem and jwt_pub.pem).
Those files are a development key pair, committed so the service starts out of the box. A real
deployment must supply its own, because anything holding the private key can mint a token that
every other component will accept.
devis the active development branch — all PRs should targetdev.mainholds released versions.
See contributing.md, our Code of Conduct and the security policy.