Auth

public class Auth

This class provides methods to connect to and logout from the established session against the server.

  • Closure called when client needs a new token

    Declaration

    Swift

    public typealias TokenRefresh = ( @escaping (_ token: String, _ provider: String) -> ()) -> ()
  • Information about user

    Declaration

    Swift

    public var user: UserDetail?
  • Connects the session and notify ClientStateDelegate when it finishes, onSuccess is called if it’s all OK or onFailure(ErrorType) if an error occurs.

    Declaration

    Swift

    public func connect(authentication: WacClient.Authentication,
                        task: @escaping (SippoTask<Void, SippoClientError>) -> ())

    Parameters

    authentication

    Token authentication, Basic authentication (user/password) or Anonymous.

    task

    Async result

  • Destroys the session established against the server.

    Declaration

    Swift

    public func logout(task: @escaping (SippoTask<Void, SippoClientError>) -> ())
  • Fetch configured oauth providers in server

    Declaration

    Swift

    public func providers(task: @escaping (SippoTask<[[String: String]], SippoClientError>) -> ())

    Parameters

    task

    Task with providers in case of success

  • Register a new push token in server

    Declaration

    Swift

    public func registerAPNS(_ token: String)

    Parameters

    token

    Token to save

    deviceId

    Unique identifier for device