- 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" - Import the self-signed certificate.
certutil -f -user -importpfx Root localhost.pfx
- Add the lines below to the hosts file.
127.0.0.1 api 127.0.0.1 identityserver - Start the applications.
docker compose up --build
- Update the
authorizationEndpointin themain.dartfile.final authorizationEndpoint = Uri.parse( 'https://<insert host here>/connect/authorize', );
- Update the
tokenEndpointin themain.dartfile.final tokenEndpoint = Uri.parse( 'https://<insert host here>/connect/token', );
- Run the Flutter application.
flutter run
- Wait for the application to start in the Android Emulator.
- Enter the Username "test@example.com".
- Enter the Password "Pass123$".
- Click the Login button.
