Skip to content

Commit

Permalink
Support a Azure AD host
Browse files Browse the repository at this point in the history
  • Loading branch information
kenchan0130 committed Sep 5, 2022
1 parent f2540a6 commit c041586
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions XCreds/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WebViewController: NSWindowController {

var password:String?
func loadPage() {

webView.navigationDelegate = self
TokenManager.shared.oidc().delegate = self
clearCookies()
Expand Down Expand Up @@ -98,7 +98,7 @@ extension WebViewController: WKNavigationDelegate {
}

// Azure snarfing
else if navigationAction.request.url?.host == "login.microsoftonline.com" {
else if ["login.microsoftonline.com", "login.live.com"].contains(navigationAction.request.url?.host) {
TCSLogWithMark("Azure")

var javaScript = "document.getElementById('i0118').value"
Expand All @@ -112,7 +112,7 @@ extension WebViewController: WKNavigationDelegate {

}
})

javaScript = "document.getElementById('confirmNewPassword').value"
webView.evaluateJavaScript(javaScript, completionHandler: { response, error in
if let rawPass = response as? String {
Expand Down

0 comments on commit c041586

Please sign in to comment.