Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to write a common API for login in two different projects with two different databases. How can I identify which project call the API and corresponding database to be used for the API function?
Posted
Updated 8-Nov-15 23:17pm
v4
Comments
BillWoodruff 9-Nov-15 7:27am    
More detail, please. What are your using for login verification ?
Member 10752313 10-Nov-15 5:33am    
Thank you. Using email and password both the application's login take place. So can I write a common function to login in both applications? If so how should I identify the database in which the username and password to be checked?
Richard MacCutchan 9-Nov-15 8:33am    
The calling application would need to provide those details to the API.
Member 10752313 10-Nov-15 5:36am    
Thank you. Thats a good idea. Is there any other way so that we can avoid the parameter in the api to identify the application? That is what I am looking for actually.
Richard MacCutchan 10-Nov-15 5:40am    
No, because there is no way a method inside the API can get any useful information about the calling application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900