$select query not working on a call to /me
I'm working on a web application and we want to allow sign in with Microsoft. Personal accounts, business accounts, anyone really. I have it working and we get the user profile back. Great. But there are fields on the user profile that we'll need to get directly as they are not on the stock user, such as proxyAddresses. But a call to /me with the $select query simply doesn't work. No matter how I do it, I get the stock user object back.
I'm using Node and microsoft-graph-client. This all seems pretty simple and I'm doing it exactly as the API recommends:
client.api('/me').select('otherMails,proxyAddresses').get()
It doesn't matter if I use multiple select statements with individual fields, put the strings in an array, or try something else, like /users/id. I always get the stock user back. I tried it in the Graph Explorer and I get the exact same problem. v1.0/me?$select=otherMails,proxyAddresses gives me the stock object without the selected fields. It even tells me to use $select in the response if I don't use it! I can't get anything but the stock object back. It doesn't matter which fields are in the $select statement.
The thing is, I also found this question on Stack Overflow from six years ago:
It seems to indicate that personal Outlook accounts simply don't work with $select statements. Please tell me that this is not the case anymore, or if it is, that there's a workaround. It looks like a Microsoft rep said that it would be documented, but I see nothing in the documentation on this issue. It should be mentioned in the Graph API docs for a /me call.
The Q&A assistant also tells me that I may not be able to get these properties on a personal account, yet the personal account in question has multiple proxyAddresses and I need that data, and it still doesn't explain why adding something like $select=displayName still returns the whole stock object instead of just the displayName. The assistant says I may have to use a different endpoint, but if so, which?
And if proxyAddresses is the wrong place to look, then where would I get the aliases? This user has a non-Microsoft username (ie, a Gmail account) which is set for the userPrincipalName and the mail property, so I can't rely on those. It does have multiple email aliases, but they're unreachable. I need to know which of those aliased addresses (if any) actually route to the users inbox, and which ones do not (likely external addresses), and I currently have no way to do so. This feels like a pretty glaring hole in the Graph API. The beta API lists all emails connected to the account, but provides no information on which ones are connected to the users inbox.