Authentication
Ensemble supports Sign In with Google, Apple as well as with Auth0.
Setup
By default Sign in is disabled. To enable it, follow the setup steps below.
Enable the Auth module
- Go to
/starter/pubspec.yamland uncomment theensemble_auth. - Go to
/starter/lib/generated/EnsembleModules.dart- Set
useAuthtotrue. - Uncomment the
ifsection to enable the AuthModuleImpl. You may also need to uncomment the import statement.
- Set
Sign in with Apple
Note that if you are using Sign in with Google on iOS, Apple requires you to also support Sign in with Apple. To enable Sign in with Apple, follow these steps:
- Open XCode from the iOS project under
/starter/iosin XCode. - Select your
Runnertarget and go toSigning & Capabilitiestab. - Click on the
+ Capabilitybutton and select "Sign in with Apple". - To enable Sign in with Apple only on iOS, you can use the Condition widget to only show if platform is iOS.
Column:
children:
- SignInWithGoogle:
# only show Sign in with Apple on iOS
- Conditional:
conditions:
- if: ${ensemble.device.isIOS()}
widget:
SignInWithApple:Implementation
- For Sign in with Google locally or with your server, go to Social Sign In.
- To use Firebase instead of your server, go to Firebase.
- For Sign in with Auth0, go to Auth0.