AuthenticationFireSocialConfig class

Inheritance
  • Object
  • BasicAuthenticationConfig
  • AuthenticationFireSocialConfig

Constructors

AuthenticationFireSocialConfig({required Uri loginCredentialsAPIendpoint(), required Uri signupCredentialsAPIendpoint(), FutureOr<AuthenticationData> customLoginResponseParser(String response)?, FutureOr<User>? customUserMapper(Map<String, dynamic> userMap)?, Uri refreshTokenAPIendpoint(String refreshToken, JWT token)?, bool debug = false, FutureOr<Map<String, dynamic>> customLoginRequestMapper(String email, String password, AuthDeviceInfo? deviceInfo)?, FutureOr<AuthenticationData>? customSignupCredentialsResponseParser(String body)?, bool authenticateOnSignup = true, FutureOr<AuthCredentialsProvider> customAutoSignupAuthClbk(AuthSignUpPayload payload, AuthenticationData? authData)?, Uri fetchUserInformationAPIendpoint(AuthenticationData data)?, FutureOr<Map<String, dynamic>> customFetchUserInformationResponseMapper(Map<String, dynamic> data)?, bool initialAuthCheckedAfterUserFetch = true, bool autoLogoutOnSessionExpired = true, Duration? maxAge, FutureOr<Map<String, String>> customRefreshTokenResponseParser(String body)?, void onRefreshToken(Map<String, String> tokens)?, String? refreshTokenMethod, FutureOr<String> customRefreshTokenRequestBodyMapper(String refreshToken, String authToken, AuthDeviceInfo? deviceInfo)?, Duration? refreshTokenTimeout, void onRefreshTokenFailure(String token, Object exception)?, required Uri deleteAccountApiEndpoint(String userId), User? deleteAccountCustomResponseParser(Map<String, dynamic> response)?, bool logoutAfterDelete = true, FutureOr<Map<String, String>> customRefreshTokenCallback(String token, String? refreshToken, AuthDeviceInfo? deviceInfo)?, Uri authenticateAppleAPIendpoint(SocialProviderResponse socialData)?, Uri authenticateFacebookAPIendpoint(SocialProviderResponse socialData)?, Uri authenticateGoogleAPIendpoint(SocialProviderResponse socialData)?, Uri authenticateAnonymouslyAPIendpoint(SocialProviderResponse socialData)?, Uri setupUserFieldsAPIendpoint(AuthenticationData authenticationData)?, FutureOr<Map<String, String>> customAuthenticationAppleRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customAuthenticationFacebookRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customAuthenticationGoogleRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customAuthenticationAnonymousRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customSetupFieldsUserRequestMapper(AuthSignUpPayload payload, AuthenticationData authData)?, FutureOr<AuthenticationData> customAuthenticationGoogleResponseParser(String response)?, FutureOr<AuthenticationData> customAuthenticationAppleResponseParser(String response)?, FutureOr<AuthenticationData> customAuthenticationFacebookResponseParser(String response)?, FutureOr<AuthenticationData> customAuthenticationAnonymousResponseParser(String response)?, FutureOr<AuthenticationData> customSetupFieldsUserResponseParser(String response)?, bool shouldDeleteOnFirebase = false})

Properties

authenticateAnonymouslyAPIendpoint → (Uri Function(SocialProviderResponse socialData)?)
Provides an endpoint to be used when trying to authenticate with anonymouly
final
authenticateAppleAPIendpoint → (Uri Function(SocialProviderResponse socialData)?)
Provides an endpoint to be used when trying to authenticate with google
final
authenticateFacebookAPIendpoint → (Uri Function(SocialProviderResponse socialData)?)
Provides an endpoint to be used when trying to authenticate with google
final
authenticateGoogleAPIendpoint → (Uri Function(SocialProviderResponse socialData)?)
Provides an endpoint to be used when trying to authenticate with google
final
authenticateOnSignup bool
Specifies if the library should automatically authenticate the user after a successful signup This will be performed just if the system successfully extracts an AuthenticationData from the response or if user have defined a customAutoSignupAuthClbk callback if this is set t true and the library fails to authenticate it will notify the result on the bloc bia AutoSignupAuthResult Defaults to true
finalinherited
autoLogoutOnSessionExpired bool
Dispatch Logout event if session expired error returned from fetchUserData API Defaults to true
finalinherited
customAuthenticationAnonymousRequestMapper → (FutureOr<Map<String, String>> Function(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?)
Provides a custom function that allows you to customize the way your request's body is sent to the API Example function(data) { return { 'custom-token-key': accessToken, } }
final
customAuthenticationAnonymousResponseParser → (FutureOr<AuthenticationData> Function(String response)?)
Provides a way to transform authenticateAnonymouslyAPIendpoint response
final
customAuthenticationAppleRequestMapper → (FutureOr<Map<String, String>> Function(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?)
Provides a custom function that allows you to customize the way your request's body is sent to the API Example function(data) { return { 'custom-token-key': accessToken, } }
final
customAuthenticationAppleResponseParser → (FutureOr<AuthenticationData> Function(String response)?)
Provides a way to transform authenticateAppleAPIendpoint response
final
customAuthenticationFacebookRequestMapper → (FutureOr<Map<String, String>> Function(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?)
Provides a custom function that allows you to customize the way your request's body is sent to the API Example function(data) { return { 'custom-token-key': accessToken, } }
final
customAuthenticationFacebookResponseParser → (FutureOr<AuthenticationData> Function(String response)?)
Provides a way to transform authenticateFacebookAPIendpoint response
final
customAuthenticationGoogleRequestMapper → (FutureOr<Map<String, String>> Function(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?)
Provides a custom function that allows you to customize the way your request's body is sent to the API Example function(data) { return { 'custom-token-key': accessToken, } }
final
customAuthenticationGoogleResponseParser → (FutureOr<AuthenticationData> Function(String response)?)
Provides a way to transform authenticateGoogleAPIendpoint response
final
customAutoSignupAuthClbk → (FutureOr<AuthCredentialsProvider> Function(AuthSignUpPayload payload, AuthenticationData? authData)?)
Provides a callback to be used when trying to signIn after a successful signup This is useful when no AuthenticationData was returned from the API call or may it's missing data It provides access to the submitted AuthSignUpPayload and the returned AuthenticationData if any. Should return a
finalinherited
customFetchUserInformationResponseMapper → (FutureOr<Map<String, dynamic>> Function(Map<String, dynamic> data)?)
Provides a way to transform fetchUserInformationAPIendpoint response to user map, then customUserMapper will be used to the
finalinherited
customLoginRequestMapper → (FutureOr<Map<String, dynamic>> Function(String email, String password, AuthDeviceInfo? deviceInfo)?)
Provides a custom function that allows you to customize the way your request's body is sent to the API Example function(email, password) { return { 'custom-email-key': email, 'custom-password-key': password, } }
finalinherited
customLoginResponseParser → (FutureOr<AuthenticationData> Function(String response)?)
Provides a way to transform Login response by providing RAW body
finalinherited
customRefreshTokenCallback → (FutureOr<Map<String, String>> Function(String token, String? refreshToken, AuthDeviceInfo? deviceInfo)?)
finalinherited
customRefreshTokenRequestBodyMapper → (FutureOr<String> Function(String refreshToken, String authToken, AuthDeviceInfo? deviceInfo)?)
Provide a function to be used in order to use/pass the refresh token to the API endpoint
finalinherited
customRefreshTokenResponseParser → (FutureOr<Map<String, String>> Function(String body)?)
Defines a custom function to parse the response of your refresh token API, you must return an object with "refreshToken" and "authToken", so it can replace your current session one Example { "auth-token": "YourParsedAuthToken", "auth-refresh-token": "YourParsedRefreshToken" }
finalinherited
customSetupFieldsUserRequestMapper → (FutureOr<Map<String, String>> Function(AuthSignUpPayload payload, AuthenticationData authData)?)
Provides a custom function that allows you to customize the way your request's body is sent to the API Example function(data) { return { { "firstName": "string", "lastName": "string", "phone": "string", "country": "string", "twitterUsername": "string" } }
final
customSetupFieldsUserResponseParser → (FutureOr<AuthenticationData> Function(String response)?)
Provides a way to transform setupUserFieldsAPIendpoint response
final
customSignupCredentialsResponseParser → (FutureOr<AuthenticationData>? Function(String body)?)
Provides a way to transform Signup with Credentials response by providing access to RAW body
finalinherited
customUserMapper → (FutureOr<User>? Function(Map<String, dynamic> userMap)?)
Provides a custom user mappers that will be using when decoding a user from user data API and from auth session
finalinherited
debug bool
Provides a flag for printing useful debugging data Defaults to false
finalinherited
deleteAccountApiEndpoint Uri Function(String userId)
Provides an endpoint to be used when request an account delete
finalinherited
deleteAccountCustomResponseParser → (User? Function(Map<String, dynamic> response)?)
Provides a way to customize the way the response is parsed
finalinherited
fetchUserInformationAPIendpoint → (Uri Function(AuthenticationData data)?)
Provides an endpoint to be used when trying to fetch with credentials
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initialAuthCheckedAfterUserFetch bool
Dispatch initialAuthChecked event just after we have an initial user fetch data Defaults to true
finalinherited
loginCredentialsAPIendpoint Uri Function()
Provides an endpoint to be used when trying to login with credentials
finalinherited
logoutAfterDelete bool
Determine if user should be logged out after account deletion Defaults to true
finalinherited
maxAge Duration?
Defines the JWT age thresshold in which the refresh token logic will trigger
finalinherited
onRefreshToken → (void Function(Map<String, String> tokens)?)
This Callback is called whenever a refresh token have been successfully retrieved It provides access to the retrieved tokens
finalinherited
onRefreshTokenFailure → (void Function(String token, Object exception)?)
This Callback is called whenever a refresh token fail to be retrieved It provides access to the refresh token used & the exception raised
finalinherited
provideDeviceInfo bool
Provides device info to be associated with auth session
finalinherited
refreshTokenAPIendpoint → (Uri Function(String refreshToken, JWT token)?)
Defines a function to the URL in which a new token can be requested Defining this property activates the 'refreshToken' mechanism
finalinherited
refreshTokenMethod String?
Defines the 'http' (POST, PUT, etc) method to be used when requesting a new token to the API
finalinherited
refreshTokenTimeout Duration?
Define a custom period to wait for the refresh token API, after defined period if no response the API call waiting for the token will throw
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setupUserFieldsAPIendpoint → (Uri Function(AuthenticationData authenticationData)?)
Provides an endpoint to be used when trying to setup User Fields
final
shouldDeleteOnFirebase bool
Indicate if the application should remove the user on firebase from the SDK Is common to rely the deletion on the backend itself Defaults to false
final
signupCredentialsAPIendpoint Uri Function()
Provides an endpoint to be used when trying to signup
finalinherited

Methods

copyWith({Uri loginCredentialsAPIendpoint()?, Uri signupCredentialsAPIendpoint()?, FutureOr<AuthenticationData> customLoginResponseParser(String response)?, FutureOr<User>? customUserMapper(Map<String, dynamic> userMap)?, Uri refreshTokenAPIendpoint(String refreshToken, JWT token)?, bool? debug, FutureOr<Map<String, dynamic>> customLoginRequestMapper(String email, String password, AuthDeviceInfo? deviceInfo)?, FutureOr<AuthenticationData>? customSignupCredentialsResponseParser(String response)?, bool? authenticateOnSignup, AuthCredentialsProvider customAutoSignupAuthClbk(AuthSignUpPayload payload, AuthenticationData? authData)?, Uri fetchUserInformationAPIendpoint(AuthenticationData data)?, FutureOr<Map<String, dynamic>> customFetchUserInformationResponseMapper(Map<String, dynamic> data)?, bool? initialAuthCheckedAfterUserFetch, bool? autoLogoutOnSessionExpired, Duration? maxAge, FutureOr<Map<String, String>> customRefreshTokenResponseParser(String body)?, void onRefreshToken(Map<String, String> tokens)?, String? refreshTokenMethod, FutureOr<String> customRefreshTokenRequestBodyMapper(String refreshToken, String authToken, AuthDeviceInfo? deviceInfo)?, Duration? refreshTokenTimeout, void onRefreshTokenFailure(String token, Object exception)?, Uri deleteAccountApiEndpoint(String userId)?, User? deleteAccountCustomResponseParser(Map<String, dynamic> response)?, bool? logoutAfterDelete, FutureOr<Map<String, String>> customRefreshTokenCallback(String token, String? refreshToken, AuthDeviceInfo? deviceInfo)?, bool? provideDeviceInfo, Uri authenticateAppleAPIendpoint(SocialProviderResponse socialData)?, Uri authenticateFacebookAPIendpoint(SocialProviderResponse socialData)?, Uri authenticateGoogleAPIendpoint(SocialProviderResponse socialData)?, Uri authenticateAnonymouslyAPIendpoint(SocialProviderResponse socialData)?, Uri setupUserFieldsAPIendpoint(AuthenticationData authenticationData)?, FutureOr<Map<String, String>> customAuthenticationAppleRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customAuthenticationFacebookRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customAuthenticationGoogleRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customAuthenticationAnonymousRequestMapper(SocialProviderResponse socialData, AuthDeviceInfo? authDeviceInfo)?, FutureOr<Map<String, String>> customSetupFieldsUserRequestMapper(AuthSignUpPayload payload, AuthenticationData authData)?, FutureOr<AuthenticationData> customAuthenticationGoogleResponseParser(String response)?, FutureOr<AuthenticationData> customAuthenticationAppleResponseParser(String response)?, FutureOr<AuthenticationData> customAuthenticationFacebookResponseParser(String response)?, FutureOr<AuthenticationData> customAuthenticationAnonymousResponseParser(String response)?, FutureOr<AuthenticationData> customSetupFieldsUserResponseParser(String response)?, bool? shouldDeleteOnFirebase}) AuthenticationFireSocialConfig
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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