0

As the mentioned https://github.com/jasonjoh/node-tutorial example is a web app. but i want to use it as a web service for example :-

i want to run this app on one machine(on server) and other apps made in(mobile apps, desktop and web app) could implemented or consume this services.

once user consume it my service would return [https://login.microsoftonline.com/common/oauth2/authorize?redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fauthorize&response_type=code&client_id=9892b97f-0026-4t3f-aa4f-5cb2olpdee7e] then this url will be open in user's device/machine browser, then user could enter his/her office 365 credentials and once he clicked on SignIn it should aging come in web service and then it authorize the user using access token which is stored on server in cookies and then get/read emails from user office 365 account.

so please suggest me is it a possible scenario ? or if you have any alternate way to do this please let me know.

Thanks in Advance

rkp
  • 15
  • 6

1 Answers1

0

Yes, this could work. You would need a web front end for the user to sign in, but you could then use the access token from a web service. Another alternative, assuming what you mean by web service, is to run in an unattended fashion by using the client credential OAuth flow, which allows an organizational admin to grant access to all mailboxes.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34
  • Thanks @Jason for response, I was able to do that but now i m getting one issue whn any device consume my service then it returns them the login urls[https://login.microsoftonline.com/common/oauth2/authorize?redirect_uri=http%3A%2F%2Flocalhost%3A8%2Fauthorize&response_type=code&client_id=] then user get login after that it redirects to my redirect uri and then it send emails to the user's browser, so issue is i don't want to show the emails on client browser i want to return the emails in json format in program in a variable not in the browser please help me out i have been stuck here – rkp Jul 22 '15 at 13:18