Skip to content

Commit

Permalink
O365: fix #92 failover for null query with non https URI
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3281 3d1905a2-6b24-0410-a738-b14d5a86fcbd
  • Loading branch information
mguessan committed Mar 4, 2020
1 parent 8bcfe38 commit 91e14c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/java/davmail/exchange/auth/O365Authenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ private String authenticateADFS(HttpClientAdapter httpClientAdapter, String resp
location = processDeviceLogin(httpClientAdapter, location);
}
String query = location.getQuery();
if (query == null) {
// failover for null query with non https URI like urn:ietf:wg:oauth:2.0:oob?code=...
query = location.getSchemeSpecificPart();
}

if (query.contains("code=") && query.contains("&session_state=")) {
String code = query.substring(query.indexOf("code=") + 5, query.indexOf("&session_state="));
Expand Down

0 comments on commit 91e14c9

Please sign in to comment.