authentication: what third-party solution for authorization in Java desktop software

Let's say I have java software that I distribute on my website.

  1. the user creates an account on my website (login + passwords) and buys a temporary access to my software.
  2. In fact, the account is created in the backend of a third-party solution.
  3. The user downloads my software.
  4. the user opens the software on his PC and connects with the credentials (login + password).
  5. The software verifies the existence of the account in the third-party solution. No connection to my backend is necessary.
  6. If the account has a valid license, then the software opens correctly.
  7. If not, then the software is blocked.

Does this scenario make sense and does a third-party solution exist?

The JAAS documentation is not clear to me. I did not understand where the logins and passwords are stored, and if they can be used through third-party solutions.

The OAuth2 documentation is also a problem for me. It seems to apply to APIs, but there is no API involved here. The goal is to have no personal backend.

The Firebase documentation seems to do what I'm looking for, but it does not work with desktop software. It's only for iOS or Android applications.

Any advice?