Auth

sealed class Auth : PortalException

Base exception class for Client Auth errors raised by io.portalhq.android.auth.PortalAuth.

These describe the authentication flow — sending a magic link, completing a redirect, reading a persisted session. Once a session exists, failures to turn it into a bearer token are Credentials errors instead.

Transport failures are not remapped here: they propagate as Api exceptions, so a rejected grant exchange still surfaces as Api.HttpBadRequest with the backend's message.

Inheritors

Types

Link copied to clipboard

Thrown when a redirect targeting this instance carries an error parameter.

Link copied to clipboard

Thrown when an OAuth login is started for a provider the auth environment has not enabled.

Link copied to clipboard

Thrown when a grant exchange returns neither a clientSessionToken nor a userJwt.

Link copied to clipboard
class InvalidUserJwt(detail: String, cause: Throwable? = null) : PortalException.Auth

Thrown when the userJwt handed to verifyTotp() cannot be read.

Link copied to clipboard

Thrown by sendMagicLink() when the magicLink configuration is absent.

Link copied to clipboard
class MalformedResponse(path: String, missing: String? = null) : PortalException.Auth

Thrown when a Client Auth response does not carry what its endpoint documents — either the { "data": … } envelope itself, or a field inside it that the flow cannot continue without.

Link copied to clipboard

Thrown when device storage itself could not be read from, written to, or deleted.

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val message: String?