A
A
alexkozlov19822019-07-18 10:27:49
symfony
alexkozlov1982, 2019-07-18 10:27:49

How to combine JWT and OAuth in Symfony?

There is a site domain.tld, which has jwt authentication by login and password entered on the client. The authentication server is located on the same domain as the site.
There was a task that the user should now enter not a login and password for authentication, but use OAuth2 from Yandex and Google.
I know how to implement user authentication via OAuth.
The question is how to build a connection with authentication through a third-party OAuth server and so that authentication is automatically enabled on our jwt server for api.
Probably, I wrote a confusion, but please help me not even with a solution, but at least in which direction to look. Maybe there are some patterns and solutions for such things.
Thanks to all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Derepko, 2019-07-18
@alexkozlov1982

Store associations between user - oauth token and user - jwt token.
Further, when receiving a token in the oauth header, look for the user and the jwt token associated with it and authorize

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question