IdentityUI
public class IdentityUI
This is the main IdentityUI object that can be used to create a user object via a UI flow.
There are two ways to start a login process, you can either start the flow from the beginning
which will be presented on a provided UIViewController, or you can provide an IdentityUI.Route
that is generally used to continue a flow from the deep link.
-
Errors thrown when setting up
See moreIdentityUI
.Declaration
Swift
public enum Error : Swift.Error
-
Declaration
Swift
public weak var delegate: IdentityUIDelegate?
-
Declaration
Swift
public let configuration: IdentityUIConfiguration
-
Declaration
Swift
@available(*, deprecated, message: "This is going to be removed in the next version. Using it encourages bugs. It is advised to not mix headless and visual login") public var identityManager: IdentityManager { get }
-
Present a screen where the user can review and accept updated terms and conditions.
In order to comply with privacy regulations, you need to make sure that the user accepts any update to terms and conditions that may have been issued since the last visit. For this reason, at the startup of your app, right after having obtained the
IdentityManager.currentUser
and verified the login status, if the user is logged-in you should calluser.agreements.status(:)
and, in case offalse
result (meaning the user has yet to accepted the latest terms), obtain the latest terms by callingIdentityManager.fetchTerms(:)
and finally call this method to present the updated terms. If the user fails to accept the terms, a logout will automatically be forced.Throws
IdentityUI.Error.mismatchingClientConfiguration
if the client configuration owned by the givenUser
instance is not the same as the one owned by the given UI configuration.Declaration
Swift
public static func presentTerms(_ terms: Terms, for user: User, from viewController: UIViewController, configuration: IdentityUIConfiguration) throws
-
Creates an IdentityUI object
Declaration
Swift
public init(configuration: IdentityUIConfiguration)
-
Creates an IdentityUI object with a provided identityManager. This is deprecated.
Declaration
Swift
@available(*, deprecated, message: "Passing in an identityManager to identityUI is not recommended as the IdentityUI does not control delegate calls to IdentityManager or it's internal User. This results in state overlap between the external IdentityManager and the IdentityUI") public init(configuration: IdentityUIConfiguration, identityManager: IdentityManager)
-
Starts the login process
Even though multiple
IdentityUI
instances can be constructed, usually only one identity process should be started at a time. An exception to this is when the identity process is started as a result of a universal (i.e. deep) link, since in that case it is possible (and somewhat likely) that an existing identity process was already in place when the user tapped on a universal links leading her back to the identity process; in that case, callingpresentIdentityProcess(from:)
on an instance ofIdentityUI
initialized with a route (e.g. withinit(configuration:route:)
) will automatically handle the case of an existing identity process (if any) for you.Declaration
Swift
public func presentIdentityProcess( from viewController: UIViewController, loginMethod: LoginMethod, localizedTeaserText: String? = nil, scopes: [String] = [] )
Parameters
viewController
which view controller to present the login UI from
loginMethod
which login method to use
localizedTeaserText
an optional text that will be displayed above the identifier text field in the login screen (may be used to provide the user with some context about the login). Text longer than three lines will be truncated with ellipsis. Note that you should supply a localized text.
scopes
which scopes you want your logged in user to have accesst to. See
IdentityManager
for more details -
Starts the login process from a route
Even though multiple
IdentityUI
instances can be constructed, usually only one identity process should be started at a time. An exception to this is when the identity process is started as a result of a universal (i.e. deep) link, since in that case it is possible (and somewhat likely) that an existing identity process was already in place when the user tapped on a universal links leading her back to the identity process; in that case, callingpresentIdentityProcess(from:)
on an instance ofIdentityUI
initialized with a route (e.g. withinit(configuration:route:)
) will automatically handle the case of an existing identity process (if any) for you.See also
init(configuration:route:)
Declaration
Swift
public func presentIdentityProcess(from viewController: UIViewController, route: Route)
Parameters
viewController
which view controller to present the login UI from
route
a parsed
IdentityUI.Route
object
-
Used by the tracking implementation to set internal tokens
Declaration
Swift
public func trackingEventsHandlerDidReceivedJWE(_ jwe: String)