According to the disclaimer on the slim-jwt-auth
landing page the middleware only processes tokens; does not provide any way to generate them.
HEADS UP! Middleware does not implement OAuth 2.0 authorization server nor does it provide ways to generate, issue or store authentication tokens. It only parses and authenticates a token when passed via header or cookie.
(emphasis is mine)
You can indeed use another library to generate JWT tokens which will then be consumed by slim-jwt-auth
. As long as both libraries implemented the specification correctly you should have no interoperability problems at least if you only use the mandatory to implement parts of the specification.
You can check jwt.io for a list of PHP libraries for JWT processing, but firebase/jwt
would be a good starting point. If instead of generating the tokens yourself you're looking into completely delegate the authentication and issuance of tokens to a third-party, then I would suggest having a look at Auth0.
Disclosure: I work at Auth0.