Skip to content

A sample Android app demonstrating the integration of Login with Amazon (LwA) SDK, enabling secure user authentication and profile retrieval for Amazon Fire tablets, Fire TV, and non-Amazon devices. ๐Ÿ”๐Ÿ“ฑ๐Ÿ“บ

License

Notifications You must be signed in to change notification settings

AmazonAppDev/login-with-amazon-sample

Login with Amazon (LwA) example for Kotlin apps

This project is a simple demonstration of Login with Amazon (LwA) SDK implementation on for below devices:

  • Amazon Fire tablets
  • Amazon Fire TV's
  • Non Amazon Devices

Overview

This sample app demonstrates how to integrate 'Login with Amazon' in an Android application. Users can authenticate using their Amazon credentials and view their profile information within the app.

Features

  • Amazon OAuth 2.0 Authentication: Secure login using Amazon credentials.
  • Profile Retrieval: Fetch and display the user's Amazon profile information post-login.
  • Responsive UI: Optimized for both smartphones and tablets.

Prerequisites

To run this app, you'll need to do the following:

Setup Instructions

Step 1: Clone the Repository

Clone the project to your local machine:

git clone https://github.com/AmazonAppDev/login-with-amazon-sample.git

Step 2: Amazon Developer Account Setup

  1. Sign in to the Amazon Developer Console.
  2. Create a new security profile.
  3. Create an API key.
  4. Store the API key in a new text file named as api_key.txt for later use.

Step 3: Configure the Project

  1. Open the project in Android Studio.
  2. Go into project view.
  3. Navigate to app -> libs.
  4. Right click jar file and add as library.
  5. Navigate to app -> src -> assets.
  6. Add api_key.txt file into the folder.
  7. Add JAR file in project found in Amazon LwA Mobile SDK downloaded as prerequisite.
  8. Extract the zip file libs->login-with-amazon-sdk.jar(copy from amazon LwA Mobile SDK).
  9. Add login-with-amazon-sdk.jar file into the app -> libs folder in the project.
  10. Add Login with Amazon button image into the app -> res -> drawable folder in the project. Also add the pressed version as well.
  11. Rename the image as btnlwa_gold_loginwithamazon to successfully load in layout.

Step 4: Building and Running the App

  1. In Android Studio, select 'Build' > 'Make Project'.
  2. Choose 'Run' > 'Run app' to launch the app on your device or emulator.

Usage

After launching the app, tap on the 'Login with Amazon' button. Enter your Amazon credentials, and upon successful authentication, the app will display your Amazon profile name and email.

Troubleshooting

  • Login Failure: Ensure your API key and package name in Amazon Developer Console match those in your project.
  • Network Issues: Verify your internet connection and Amazon service availability.

Get support

If you found a bug or want to suggest a new [feature/use case/sample], please file an issue.

If you have questions or need help with code, make sure to ask in our Appstore developer community Q&A category. In addition, we are available at

Stay updated

Get the most up to date Amazon Appstore developer news, product releases, tutorials, and more:

Authors

About

A sample Android app demonstrating the integration of Login with Amazon (LwA) SDK, enabling secure user authentication and profile retrieval for Amazon Fire tablets, Fire TV, and non-Amazon devices. ๐Ÿ”๐Ÿ“ฑ๐Ÿ“บ

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages