Constant redirect when logging in
Steps to reproduce:
- npm Install
- npm Start
- Nav to locahost:3000
- Enter credentials to log in
Expected result Log-in with office graph
Actual result Back to localhost:3000/login
Notes: Console is empty URL displays: http://localhost:3000/login?error=unauthorized_client&error_description=AADSTS70001%3a+Application+%278da52ad8-962c-48ea-886c-5bf72505c834%27+is+not+supported+for+this+API+version.%0d%0aTrace+ID%3a+23f4d94b-8467-45c1-8d0d-a17f2285b9f2%0d%0aCorrelation+ID%3a+7dde97db-8726-42bb-a84c-952683694319%0d%0aTimestamp%3a+2016-06-02+17%3a11%3a23Z
Hi @DaveVoyles
Quick question. Did you register your app in the Application Registration Portal?
If that's the case, the URL shows the right error message. The application is not supported for this API version.
This sample uses ADAL for Node.js, which still doesn't support apps registered in the App Registration Portal. Use the Office 365 App Registration Tool instead to register your app.
Let me know if that solves the issue. Thank you.
I'm glad you said something -- I didn't realize there was a third portal to register at!

I registered there, and all seems to work well. However, I tried logging into the app with my work credentials (I also work at Microsoft) via Dvoyles at microsoft, entered my password, received a phone call for two-factor auth, but then when the login page returned, (https://login.microsoftonline.com/login.srf) it said:
Sorry, but we’re having trouble signing you in. We received a bad request.
Does this not work for Microsoft / corp accounts?
Although, when I logged in with:
[email protected] (My office 365 dev account, which I registered the app with), it worked fine.
It seems like outlook and hotmail accounts do not work either. I've tried logging in with those, and it just redirects me to this page:

Oh, the 2nd and 3rd portals are essentially the same. app-registration is just a wrapper that registers the app on manage.windowsazure.com
The first one is used to register apps with the Azure App Model v2. Unfortunately, the libraries that we are using are still not ready for this new model. I'll update this sample when the libraries have support for the new model.
You're right, the sample doesn't work with Microsoft corp accounts. I'll look into it, but I think that the library also has problems with custom sign-in pages (like ours).
Outlook and Hotmail accounts do not work. I know the sign-in page is a little confusing regarding what accounts you can use. Hopefully, this will be solved when we have support for the new app model.
Thank you for trying the sample. Let me know if you have any other questions (or suggestions).
OK, thank you for clarifying, now I understand!
Do you know of a sample that I could use to parse the office graph from a corp account?
Essentially I'm trying to log in via my corp ID, grab the name + loc of my co-workers, and draw that to a map.
Mmm... the PHP version of this sample works with my corporate account. Office 365 PHP Connect sample using Microsoft Graph
The PHP sample doesn't use an authentication library. That should be okay for a demo, but for production, you should use an OAuth library.
Oh, I forgot to ask, are you looking specifically for a node sample? Or does the PHP sample work for you?
Yes please, it would have to be a node sample, as I am building this for a tutorial series around node and Office.
So that I better understand, is the issue that the Office graph cannot be parsed w/ a corp account, or just that this auth library does not support that?
The issue is that the authentication library doesn't support multiple tenants. At the moment, if you use this library you can only authenticate users from the same tenant where you registered the web application.
Since #41, this sample supports users from multiple tenants as a consequence of supporting the App Model v2. I believe this should take care of this issue. Feel free to reopen the issue if that is not the case.