pub package Build Status Coverage Status

A Flutter plugin for using Login with Amazon on Android and iOS.


In addition to adding a pubspec dependency, this plugin requires Login with Amazon setup which requires modification of the native Android and iOS code of your flutter application.

Add a dependency to your pubspec.yml file

See the installation instructions on pub.

Login with Amazon

Register for Login with Amazon access and create API keys for Android and iOS as described in the documentation.


  1. Create a Login with Amazon API key for Android.

  2. Create a text file located at {project_root}/android/app/src/main/assets/api_key.txt

  3. Copy-paste the contents of the API key from the Login with Amazon console into the file {project_root}/android/app/src/main/assets/api_key.txt



  1. Create a Login with Amazon API key for iOS.

  2. Add the APIKey key to the iOS properties file located at {project_root}/ios/Runner/Info.plist. The {api_key} should be the API key copy-pasted from the Login with Amazon console.

  1. Add the CFBundleURLTypes key to the iOS properties file located at {project_root}/ios/Runner/Info.plist. The {bundle_id} should be the bundle identifier of your application. (Example of a bundle id: com.github.ayvazj.example)
  1. Update {project_root}/ios/Runner/AppDelegate.m to add the #import <LoginWithAmazon/LoginWithAmazon.h> import statement as well as the (BOOL)application:(UIApplication *)application openURL:(NSURL *) url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options method.

#import <LoginWithAmazon/LoginWithAmazon.h>

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application openURL:(NSURL *) url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    return [AMZNAuthorizationManager handleOpenURL:url



A sample of a complete Info.plist file can be found here.


How do I use it?

The plugin follows the same patterns as the Google Signin API to make integration simple. For a complete sample see the example application.

import 'package:flutter_lwa/lwa.dart';

LoginWithAmazon _loginWithAmazon = LoginWithAmazon(
  scopes: <Scope>[ProfileScope.profile(), ProfileScope.postalCode()],

class _MyAppState extends State<MyApp> {
  LwaAuthorizeResult _lwaAuth;

  void initState() {
    _loginWithAmazon.onLwaAuthorizeChanged.listen((LwaAuthorizeResult auth) {
      setState(() {
        _lwaAuth = auth;

  Future<void> _handleSignIn(BuildContext context) async {
    try {
      await _loginWithAmazon.signin();
    } catch (error) {
      if (error is PlatformException) {
          content: Text("${error.message}"),
      } else {
          content: Text(error.toString()),

  Future<void> _handleSignOut() => _loginWithAmazon.signOut();