PredixAuthenticationView
open class PredixAuthenticationView: UIView
Provides an authentication view that represents the default Predix UAA authentication view.
The authentication view is intended to handle most of the interactions with UAA for you using a native UI form. Simply provider your configuration and tell the PredixAuthenticationView to start authentication.
NOTE: The baseURL, clientId and clientSecret can be defined in your info.plist instead of in code using the following keys: server_url, client_id and client_secret
Example usage from Interface builder:
class ViewController: UIViewController, PredixAuthenticationViewDelegate { @IBOutlet weak var authenticationView: PredixAuthenticationView!
override func viewDidLoad() {
super.viewDidLoad()
var configuration = AuthenticationManagerConfiguration()
configuration.baseURL = URL(string: "https://youruaahost.com")
configuration.clientId = "a clientID"
configuration.clientSecret = "a client secret"
authenticationView.configuration = configuration
authenticationView.beginAuthentication()
}
func authenticationComplete(success: Bool, error: Error?) {
//Code you want to execute when Authentication has completed
}
}
-
Indicates if authentication is in progress
Declaration
Swift
open private(set) var authenticationInProgress = false
-
The title image that will be displayed above the email filed
Declaration
Swift
open let titleImageView: UIImageView = UIImageView()
-
The email text filed used by the authentication view
Declaration
Swift
open let emailTextField: UITextField = UITextField()
-
The password text filed used by the authentication view
Declaration
Swift
open let passwordTextField: UITextField = UITextField()
-
The sign-in button used by the authentication view
Declaration
Swift
open let signInButton: UIButton = UIButton(type: .system)
-
An authentication configuration to be used with the underlying authentication manager
Declaration
Swift
open var configuration: AuthenticationManagerConfiguration = AuthenticationManagerConfiguration()
-
A ServiceBasedAuthenticationHandler to use with the authentication manager defaults to UAAServiceAuthenticationHandler
Declaration
Swift
open var onlineHandler: ServiceBasedAuthenticationHandler?
-
The authentication manager that is used by the PredixAuthenticationView to authenticate with Predix UAA
Declaration
Swift
open internal(set) var authenticationManager: AuthenticationManager?
-
Title image you want to use for the title header that is displayed above the email text field
Declaration
Swift
open var titleImage: UIImage? = UIImage(named: "predixTitle.png", in: Bundle(for: PredixAuthenticationView.self), compatibleWith: nil)
-
The PredixAuthenticationViewDelegate
Declaration
Swift
public weak var delegate: PredixAuthenticationViewDelegate?