Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lapinek/23bcb5912ceab86e7fa9d1c61aa5468d to your computer and use it in GitHub Desktop.
Save lapinek/23bcb5912ceab86e7fa9d1c61aa5468d to your computer and use it in GitHub Desktop.
// 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