onboard abstract method
- AtOnboardingRequest atOnboardingRequest, {
- String? cramSecret,
This method activates an atSign for the first time, pairing it with the application used for onboarding.
Performs one-time CRAM (Challenge-Response Authentication Mechanism) authentication and sets up RSA keys pairs for future interactions.
Upon successful CRAM Authentication, an RSA key pair is generated for PKAM authentication (Public Key Authentication Mechanism). Another RSA key pair and AES Key is generated for the data encryption.
The generated keys are stored into the key-chain manager and are populated into the AtOnboardingResponse.atAuthKeys which should be securely stored for the subsequent login.
final String atSign = '@alice'; // Represents the atSign to onboard.
final String cramKey = 'abc123'; // Represents the key used for CRAM Authentication which is fetched from the QR code.
final AtClientPreferences atClientPreferences = AtClientPreferences();
AtAuthService atAuthService = AtClientMobile.authService(atSign, atClientPreferences);
AtOnboardingRequest atOnboardingRequest = AtOnboardingRequest(atSign);
AtOnboardingResponse atOnboardingResponse = atAuthService.onboard(atOnboardingRequest, cramSecret: cramKey);
Sets AtOnboardingResponse.isSuccessful
to true if onboard process is completed successfully; else set to false.
Throws AtException if an invalid CRAM Secret is set.
Throws AtAuthenticationException
if AtOnboardingResponse.atAuthKeys
is not populated with generated
RSA key pairs and AES key.
Implementation
Future<AtOnboardingResponse> onboard(AtOnboardingRequest atOnboardingRequest,
{String? cramSecret});