I have a "difficult" problem that i am not sure how should i approach it. Basically i have a mobile app, that has a server side (in Go) and the appropriate base (PSSQL). User can register via the standard procedures, via email, google, twitter etc and create a profile, and after that "use" the app(This is app B).

Now i have a totally different web application, that is written in php and has it owns database (MySQl)(let us call this App A).

My task is to allow user that has already profile on App A, to use that profile to login to my mobile application(App B). The right way to do this is with Oauth, however, i never worked on something like this before and it does not seem to be trivial. Another problem is that the app A is running on some old version of PHP and i have not worked with it before. The site is not much maintained anymore, i do not have experience with php and i am working on my own with this, so i can not consult with anyone to help me out.

So i am working into alternatives, to make this a bit easier but i can not find a good "alternative". I was thinking of something inline, if the user wants to login with his profile on site A, that i should first take him from the mobile app to my backend (both are App B), from there i should check if the provided information is valid on App A, and if it is true then i should create a new account on my App B for him. For subsequent login, i would then do the same principle just check if he already has an account here. But somehow this seems to be too simple and not the right way to do things. I should also mention that besides the login, the stuff that they can do on both app are totally different, they do not share any data between the applications.

Im sorry if this is the wrong site to ask, but im stuck on this and i would like to get some opinions. Here is a picture trying to explain the "architecture" but i am a terrible artist. Thanks for your help.

enter image description here

1 Answer 1


Creating OAuth server in application A would be the most flexible solution. However, it is not trivial when you don't have experience in OAuth and some framework covering common cases for you. If you don't have plans to extend capability to log in/use info from app A you can try to create more dedicated solution. Of course coupling between components will increase. So, if you don't want to touch PHP code, you can try to build some API on top of MySQL itself to expose methods :

  1. check credentials
  2. retrieve profile info (with credentials or token)

Of course with assumption that you don't have additional business logic in php needed to include. If you have, you should create interface for that logic and create module which could expose your data. You can read about anti corruption layer pattern.

All these have some trade-offs, you need to analyze pros and cons for your specific case.

  • Sorry for the late response i totally forgot about this. In the way i did implement it similarly how you have described it. Thanks for taking your time and looking into it.
    – Tokikko
    Apr 18, 2018 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.