Clicking "Return to the application without granting consent" on the Office365 authentication screen redirects you back to
which gives a 400 error
Message Required String parameter 'code' is not present
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Looks like an & is missing in the query string.