- display the Sign in with Mysoleas button;
- authenticate a user with OAuth2/OIDC;
- retrieve a JWT and user claims;
- read the user profile with
userinfo; - delegate session and identity management to Mysoleas;
- focus on your application’s own business logic.
Create an OAuth2 application
Before you use OAuth2, create an application in the Mysoleas dashboard.- Create or use a Mysoleas account.
- Sign in to the dashboard:
- Open the OAuth2 applications section.
- Create a new application.
- Configure your allowed redirect URLs.
- Copy the
client_idand, if your application type allows it, theclient_secret. - Enable the scopes required by your integration.
SoleasPay application fee configuration
A SoleasPay payment/API application can definefeeBearer to indicate who pays the fees for direct API payments initiated with its credentials.
This configuration does not concern the OAuth2 client used only for Sign in with Mysoleas. It concerns applications that later call payment business services.
This configuration is read from the authenticated application. Do not send an arbitrary
applicationId in a payment to try to change who pays the fees.
Three different uses
Choose the right flow
Integrate Sign in with Mysoleas
The recommended flow for a third-party application isauthorization_code with PKCE.
Your button must redirect the user to the Mysoleas authorization endpoint with your application’s OAuth2 parameters.
Use Identity Cloud without the gateway
If your application only wants to delegate authentication to Mysoleas, the flow stops after JWT validation and theuserinfo call.
Your backend can then:
- create or find the local user matching the
subclaim; - attach the user to an organization, workspace, or tenant in your application;
- open an application session;
- apply your own roles and permissions;
- continue using your own business APIs without going through
api.mysoleas.com.
Request a token
After the OAuth2 callback, your backend exchanges thecode for a token.
For a server-to-server integration, use the client_credentials grant directly.
Call the API
If your application then consumes Mysoleas business services, all protected gateway routes expect the token inx-sp-auth-token.
Use context headers
These headers are useful for multi-country integrations, separated environments, and debugging.OAuth discovery
You can read OAuth and OIDC metadata.Best practices
- Never put
client_secretin the browser. - Renew the token before it expires.
- Store tokens in memory or in a vault suited to your backend.
- Use a stable idempotency key for every operation that can be replayed after a timeout.
- Log
transaction_reference,invoice_reference, andX-Request-Idtogether.
