Created
March 7, 2020 22:02
-
-
Save lapinek/23bcb5912ceab86e7fa9d1c61aa5468d to your computer and use it in GitHub Desktop.
This file contains hidden or 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. | |
Serves as a reference to the App Group for sharing the authentication state. | |
*/ | |
let appGroup = "group.com.forgerock.sso-webview" | |
/** | |
Cookies to be shared with the App Group. | |
*/ | |
let appGroupCookies = ["iPlanetDirectoryPro"] | |
/** | |
Reference to a request object built by AppAuth. | |
This will be used to build AppAuth `OIDAuthorizationResponse` to continue authorization with the SDK after redirection event in the web view. | |
*/ | |
var oidAuthorizationRequest: OIDAuthorizationRequest? = nil | |
/** | |
Reference to the class providing web view. | |
*/ | |
var webViewController: WebViewController! | |
/** | |
Reference to the web view via its `tag` property. | |
*/ | |
var webViewTag = 1 | |
/** | |
Completes successful authorization. | |
This property serve as a placeholder for authorization completion handler for being called from a different context than one the authorization was initiated in. In this example, it sets the authorization state and performs callbacks—if any. | |
*/ | |
var authorizationCompletion: ((OIDAuthState?, Error?) -> Void)? = nil | |
// . . . | |
} | |
// . . . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment