Azure-Samples / ms-identity-java-webapp

A Java web application calling Microsoft graph that is secured using the Microsoft identity platform
MIT License
118 stars 105 forks source link

Issues while running msalwebsample #44

Closed sarveshkapre closed 4 years ago

sarveshkapre commented 4 years ago

https://github.com/Azure-Samples/ms-identity-java-webapp/blob/master/msal-java-webapp-sample/src/main/java/com/microsoft/azure/msalwebsample/AuthHelper.java#L166

I followed the steps as mentioned in Readme and ran into some deserialization issues while fetching access token. My guess is the above line causes the Authorization Response parameters to be encoded using application/x-www-form-urlencoded which are not well handled thus resulting in deserialization issues while trying to fetch access_tokens or while checking if the user has auth data in the session.

I was able to get the sample application working after removing the highlighted line mentioned above.

AniketBhadane commented 4 years ago

https://github.com/Azure-Samples/ms-identity-java-webapp/blob/master/msal-java-webapp-sample/src/main/java/com/microsoft/azure/msalwebsample/AuthHelper.java#L166

I followed the steps as mentioned in Readme and ran into some deserialization issues while fetching access token. My guess is the above line causes the Authorization Response parameters to be encoded using application/x-www-form-urlencoded which are not well handled thus resulting in deserialization issues while trying to fetch access_tokens or while checking if the user has auth data in the session.

I was able to get the sample application working after removing the highlighted line mentioned above.

Thank you for this. I commented "response_mode=form_post&" line and things started working. Otherwise I was getting 403 forbidden. I spent 2 days on this. Thank you

sangonzal commented 4 years ago

@sarveshkapre @AniketBhadane Thanks, this has been fixed in the sample and should now work.