0

Using Microsoft Graph, I'd like to be able to access user profile data (such as Preferred Name, Last Name and Manager) for arbitrary users without needing a user to login, since I'm writing a web service.

Is this possible? If so, how?

UPDATE 01: I expect the calling app to be authenticated against the tenant without needing a user to login (except to register the calling app, once?), or service account type of access as explained by @David below.

2 Answers 2

2

What we call daemon/server-side apps (in OAuth - client credential flow) is supported by Microsoft Graph. Please see this first https://graph.microsoft.io/en-us/docs/authorization/auth_overview. When you've digested that, read https://graph.microsoft.io/en-us/docs/authorization/app_only. I would recommend (if possible) that you go down the v2 endpoint path which is documented here: https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols-oauth-client-creds/

Is there a reason why your service needs to make these calls without a signed-in user being present?

Hope this helps,

Sign up to request clarification or add additional context in comments.

Comments

0

Are you asking for anonymous access to tenant/user data? If so, then that is just asking for someone to farm O365. Or are you saying that you want some "service account" type of access that has rights to a particular org so that you can get access to user profile data within that org without requiring the user to explicitly sign on or grant consent to your app?

3 Comments

Not asking for anonymous access. I was hoping that the calling app would be authenticated against the tenant using the clientid/clientsecret mechanism.
@david-sterling-msft, is it possible to create "service account" you talking about? The main problem is that service/daemon access is not enough in most cases to perform a lot of automatic tasks (i.e. create a document and put it to user's OneDrive, create a task in user's Planner and so on). In my case these actions should be performed without any user interactions, as a result of some events (service detects an event, then creates tasks for users, probably documents and so on).
OAuth is a bit different. You might want to check out the app only stuff: learn.microsoft.com/en-us/azure/active-directory/develop/…

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.