From the looks of the fragment, it appears you are trying to accomplish an OAuth flow. The problem I see is that you are trying to implement a flow that is meant for the client side (or more correctly, user-agent side), and then trying to access the fragment on the server, which is meant to be interpreted on the user-agent side.
The #access_token..
tells me you are trying to implement the Implicit Grant. This is not recommended if you have access to the more common Authorization Code Grant. I don't know what Microsoft service you are using, but if they offer the Implicit Grant, then they should also offer the Authorization Code Grant, which is actually the most common in all of the Grant types.
If you want to stick with the Implicit Grant, then you will need to actually handle the redirect from the client (user-agent) side, meaning get your hands into writing some Javascript to postback the token to the server. You can see an example here.
I personally wouldn't recommend it. You can have a look at the Jersey OAuth 2.0 client. It will help with implementing the Authorization Code flow.