Skip to content

Latest commit

 

History

History
46 lines (43 loc) · 1.46 KB

File metadata and controls

46 lines (43 loc) · 1.46 KB

Authenticating a Flutter Android Application using IdentityServer 5

YouTube

Getting Started

  1. Generate a self-signed certificate.
    openssl req -x509 -newkey rsa:4096 -keyout localhost.key -out localhost.crt -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,DNS:api,DNS:identityserver"
    openssl pkcs12 -export -in localhost.crt -inkey localhost.key -out localhost.pfx -name "Authenticating a Flutter Android Application using IdentityServer 5"
  2. Import the self-signed certificate.
    certutil -f -user -importpfx Root localhost.pfx
  3. Add the lines below to the hosts file.
    127.0.0.1 api
    127.0.0.1 identityserver
    
  4. Start the applications.
    docker compose up --build
  5. Update the authorizationEndpoint in the main.dart file.
    final authorizationEndpoint = Uri.parse(
      'https://<insert host here>/connect/authorize',
    );
  6. Update the tokenEndpoint in the main.dart file.
    final tokenEndpoint = Uri.parse(
      'https://<insert host here>/connect/token',
    );
  7. Run the Flutter application.
    flutter run
  8. Wait for the application to start in the Android Emulator.
  9. Enter the Username "test@example.com".
  10. Enter the Password "Pass123$".
  11. Click the Login button.