@Paolo there are oauth2 provider written in php and many other languages. have you find any solution for your problem?