native abstract method
Authenticates the user using the native Sign in with Apple/Google dialogs on these platforms.
This API enables a more streamlined user experience than the equivalent browser based OAuth authentication, when using the appropriate provider on iOS/Android devices. The authentication presents a native dialog that lets the user sign in with the account they're already using on their device.
This function expects the name of the provider the user wishes to authenticate with,
this will usually be either, Apple
, Google
or the name of a custom provider that's
configured for OAuth with one of them.
Note: This is an asynchronous operation that performs network requests before and after displaying the modal authentication view. It is thus recommended to switch the user interface to a loading state before calling this function, otherwise the user might accidentally interact with the app when the authentication view is not being displayed.
If you haven't already configured your app to support Sign in with Google you'll
probably need to set up your Google APIs console project
for this. You should also configure an OAuth provider for Google in the in the
Descope console,
with its Grant Type
set to Implicit
. Also note that the Client ID
and
Client Secret
should be set to the values of your Web application
OAuth client,
rather than those from the Android
OAuth client. For more details see the
Credential Manager documentation.
The Sign in with Apple APIs require some setup in your Xcode project, including
at the very least adding the Sign in with Apple
capability. You will also need
to configure the Apple provider in the Descope console.
In particular, when using your own account make sure that the Client ID
value
matches the Bundle Identifier of your app. For more details see the
Sign in with Apple documentation.
Implementation
Future<AuthenticationResponse> native({required OAuthProvider provider, SignInOptions? options});