AuthenticationDetails

public struct AuthenticationDetails : AuthenticationProviderIdentity, Codable, Equatable, CustomStringConvertible, CustomDebugStringConvertible
extension AuthenticationDetails: WebcomCombinable

A value containing information about an authenticated user.

To authenticate a user, one or more authentication methods are used.

Stored Properties

  • The authentication token.

    Declaration

    Swift

    public let authenticationToken: String
  • The creation date of the user account.

    Declaration

    Swift

    public let creationDate: Date
  • The display name of the user, or nil when it is unavailable.

    Declaration

    Swift

    public let displayName: String?
  • The expiration date of the authentication.

    Declaration

    Swift

    public let expirationDate: Date
  • For email or phone authentication methods, optional password expiration timestamp.

    Declaration

    Swift

    public let passwordExpiresAt: Date?
  • The provider of the current identity.

    Declaration

    Swift

    public let provider: AuthenticationProvider
  • For email or phone login methods, this field gives the identity provider method which was used to authenticate the user (“otp” or “password”).

    Declaration

    Swift

    public let providerMode: AuthenticationProvider.ProviderMode?
  • The unique identifier of the user for the current identity.

    Declaration

    Swift

    public let providerUID: String
  • uid

    The unique identifier of the user for the back-end.

    Declaration

    Swift

    public let uid: String

Initializers

  • Declaration

    Swift

    public init(from decoder: Decoder) throws

Encodable Protocol

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws

API

  • The providers used to get the different identities, starting from the current one.

    By definition, the resulting array is never empty.

    Declaration

    Swift

    public var providers: [AuthenticationProvider] { get }
  • Additional data specific to the provider of the latest identity.

    Typically, an OAuth2 provider may provide confidential data such as access or refresh tokens.

    This property contains technical data while providerExtra contains data about the authenticated user.

    Declaration

    Swift

    public var providerExtra: [String : Any] { get }
  • The profile of the user for the provider of the latest identity.

    This property contains data about the authenticated user while providerExtra contains technical data.

    Declaration

    Swift

    public var providerProfile: [String : Any] { get }
  • The previous provider identities.

    Declaration

    Swift

    public var previousProviderIdentities: [AuthenticationProviderIdentity] { get }
  • The e-mail of the user, or nil when it is unavailable.

    Declaration

    Swift

    public var eMail: String? { get }
  • The identity of the user, or nil when it is unavailable.

    When the provider is AuthenticationProvider.internal(_:), the returned value is the providerUID. Otherwise, it is the eMail value.

    Declaration

    Swift

    public var identity: String? { get }
  • The URL of an avatar representing the user, or nil when it is unavailable.

    Declaration

    Swift

    public var avatarURL: URL? { get }
  • Downloads the avatar representing the user.

    This method downloads the content from avatarURL.

    Declaration

    Swift

    public func downloadAvatar(session: URLSession? = nil, queue: DispatchQueue? = nil, then completionCallback: @escaping WebcomResult<UIImage>.Callback)

    Parameters

    session

    The session to use to download the avatar. When nil, Webcom.defaultSession is used.

    queue

    The queue to which the provided callback dispatches. When nil, Webcom.defaultCallbackQueue is used.

    completionCallback

    The closure to call upon completion. In case of success, it is called with the downloaded avatar. In case of failure, it is called with a WebcomError value indicating the reason of the failure.

CustomStringConvertible Protocol

  • Declaration

    Swift

    public var description: String { get }

CustomDebugStringConvertible Protocol

  • Declaration

    Swift

    public var debugDescription: String { get }

Combine Module

  • The type that wraps AuthenticationDetails in order to enrich it with a Combine-based API.

    See also the documentation section of WebcomWrapper for the corresponding wrapped type.

    To use this type, import the following dependency in your code:

    import WebcomCombine
    
    See more

    Declaration

    Swift

    public struct CombineWrapper : WebcomWrapper, Equatable, CustomStringConvertible, CustomDebugStringConvertible
  • The wrapping instance, which has a Combine-based API.

    Declaration

    Swift

    public var forCombine: CombineWrapper { get }