View OAuth2.AppAuth-iOS.SSO.Embedded.iOS-AppAuth-Basic.ViewController.WKScriptMessageHandler.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ViewController.swift | |
// . . . | |
// MARK: Conforming to WKScriptMessageHandler protocol | |
extension ViewController: WKScriptMessageHandler { | |
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { | |
print(#function) | |
if message.name == "callback", let messageBody = message.body as? String, let messageBodyData = messageBody.data(using: .utf8) { |
View OAuth2.AppAuth-iOS.SSO.Embedded.AuthenticationResponse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AuthenticationResponse.swift | |
import Foundation | |
/** | |
Container for JSON callbacks expected from the authentication endpoint. | |
*/ | |
struct AuthenticationResponse: Codable { | |
struct Callback: Codable { | |
let type: String? |
View OAuth2.AppAuth-iOS.SSO.Embedded.WebViewController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WebViewController.js | |
(function () { | |
if (window.webkit) { | |
var response = { | |
"authId": "authId", | |
"callbacks": [ | |
{ | |
"type": "Code", | |
"input": [], |
View OAuth2.AppAuth-iOS.SSO.Embedded.iOS-AppAuth-Basic.ViewController.WebKit.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ViewController.swift | |
// . . . | |
import WebKit | |
// . . . |
View OAuth2.AppAuth-iOS.SSO.Embedded.iOS-AppAuth-Basic.ViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ViewController.swift | |
// . . . | |
class ViewController: UIViewController { | |
// . . . | |
/** | |
App Group name. |
View OAuth2.AppAuth-iOS.SSO.Embedded.SSO-WebView-1.ViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ViewController.swift | |
import UIKit | |
class ViewController: UIViewController { | |
var webViewController: WebViewController! | |
// . . . | |
/** |
NewerOlder