Skip to content

Commit

Permalink
[Teacher][R-1.8.1] Siteadmin login fix (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanMarshall authored Jun 27, 2019
1 parent 4fb4d4d commit e3ddf17
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,17 @@ final protected void loadAuthenticationUrl(final String apiProtocol, final Strin
mAuthenticationURL += "&canvas_login=1";
} else if (mCanvasLogin == MASQUERADE_FLOW) {
// canvas_sa_delegated=1 identifies that we want to masquerade
final String cookie = "canvas_sa_delegated=1;domain=.instructure.com;path=/;";
CookieManager cookieManager = CookieManager.getInstance();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.setAcceptThirdPartyCookies(mWebView, true);
}
cookieManager.setCookie(apiProtocol + "://" + domain, cookie);
cookieManager.setCookie(".instructure.com", cookie);
if (domain.contains(".instructure.com")) {
String cookie = "canvas_sa_delegated=1;domain=.instructure.com;path=/;";
cookieManager.setCookie(apiProtocol + "://" + domain, cookie);
cookieManager.setCookie(".instructure.com", cookie);
} else {
cookieManager.setCookie(domain, "canvas_sa_delegated=1");
}
}
mWebView.loadUrl(mAuthenticationURL, getHeaders());

Expand Down

0 comments on commit e3ddf17

Please sign in to comment.