MLogin class

Central access point to the MLoginSDK. All functionality is triggered via the calls defined in here.

While the SDK is stateless and an MLogin object can be created on demand, it is recommended to create only once instance and cache it as some of the internally created class can be costly.

See MLoginLog for debugging purposes.

Constructors

MLogin({required MLoginConfig config, required String redirectUri, required String callbackUrlScheme, required String clientId, String? loggedInMLoginUserId, String? prefilledUsername})
Creates a new MLogin object.

Properties

callbackUrlScheme String
Necessary to catch when the web process finishes in iOS. MUST match the redirectUri
final
clientId String
Identifies the app using this MLoginSDK. Ask the MLogin team for a valid clientId. MUST match the redirectUri, access attempts will fail otherwise.
final
config MLoginConfig
Defines which MLogin tier is to be accessed (i2, k, p)
final
hashCode int
The hash code for this object.
no setterinherited
loggedInMLoginUserId String?
loggedInMLoginUserId Identifies the user that is currently logged-in in the app using the SDK. Optional, but it is strongly recommended to set this if possible. See constructor documentation of the constructor.
getter/setter pair
prefilledUsername String?
May be used to present a username in the MLogin mask. In cases where there is an active MLogin on the device which differs from the MLogin account used in the current app (which should be represented by a valid loggedInMLoginUserId, calling an MLogin SDK function to open a data page (like openPortalOverview) will display a new login mask with the prefilledUsername entered in the e-Mail input field.
getter/setter pair
redirectUri String
Defines the full url used when capturing redirects. MUST match the clientId, login attempts will fail otherwise.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secureRandom Random
final

Methods

login({String prefix = '', String postfix = '', String scopes = '', bool ephemeral = false}) Future<MLoginResult>
Start the MLogin login flow: Opens a secure browser environment where the user can enter her existing MLogin credentials - or create a new account in case she does not yet have an account.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openDriverLicenseVerification({bool ephemeral = false, String? overrideRedirectUri}) Future<bool>
Opens the M-Login portal in a secure web browser environment, focused on the driver license page.
openGrantSepaMandatePage(String methodId, {bool ephemeral = false, String? overrideRedirectUri}) Future<bool>
Opens a page in the browser where the user can grant a SEPA mandate for payments, using the already entered bank account information in the M-Login.
openPayAuthorizationErrorRecovery(String recoverableErrorPayload, {bool ephemeral = false, String? overrideRedirectUri}) Future<bool>
Convenience function to open the browser on a page that prompts the user to recover from a payment authorization error that is marked as "recoverable" (see M-Login API specs)
openPaymentMethodsOverviewPage({bool ephemeral = false, String? overrideRedirectUri}) Future<bool>
Opens the M-Login portal in a web browser, focused on the payment methods page. In there, the user can review her payment methods and edit them. Does not require previous Login. In case there is no valid login present in the browser, the user will be prompted to log in again.
openPhotoUpload({bool ephemeral = false, String? overrideRedirectUri}) Future<bool>
Opens the external photocollect library, which enables the user to take a photo using her device or upload an existing picture. The picture should be a portrait of the user, and is validated by the library for correct format.
openPortalOverview({bool ephemeral = false, String? overrideRedirectUri}) Future<bool>
Opens the M-Login portal in a web browser, focused on the profile page (name, address, birthday, email, ...). In there, the user can review and change her data. Does not require previous Login. In case there is no valid login present in the browser, the user will be prompted to log in again.
register({String prefix = '', String postfix = '', String scopes = '', bool ephemeral = false}) Future<MLoginResult>
Start the MLogin register flow: Opens a secure browser environment where the user can create a new M-Login account - or sign in to an existing account in case it turns out she already has one.
startCitFlow(String url, {bool ephemeral = false}) Future<MLoginCitResult>
Start a customer initiated transaction (CIT). Opens a secure browser environment at url which should allow the user to perform the transaction and redirect to the app afterwards.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited