Android
For the App to App
flow to work properly, a correct deep link configuration is required. That means
- for Android:
Android App Links
are required: https://developer.android.com/training/app-links - for iOS:
Universal Links
are required: https://developer.apple.com/ios/universal-links/
This example uses https://github.com/openid/AppAuth-Android and implements the App to App
flow as specified by gematik in https://wiki.gematik.de/display/IDPKB/App-App+Flow.
Source: https://github.com/azuma-healthtech-public/mimoto-examples/tree/main/android-app-auth-code-exchange
Therefore, this example uses:
- mock IDP authenticator (short:
IDP-App
)- Source: https://github.com/azuma-healthtech-public/mimoto-examples/tree/main/android-gematik-mock.
- Deep Link Url: https://mimoto-gematik-mock.azuma-health.tech/idp/par
- Important: Replace the X-Auth-Header value here.
- example DiGA application (short:
DiGA-App
), which can be found here: https://github.com/azuma-healthtech-public/mimoto-examples/tree/main/android-app-auth-code-exchange. (Deep Link Url: https://mimoto-example-app.azuma-health.tech/app/ce) - azuma mimoto as Gesundheits-ID as a service
Pre-Requirements: Configuration in mimoto
In our example, we have configured the Application
in azuma mimoto as follows:
Screenshot: Application Configuration
Flow (with IDP list in web browser)
See Documentation
Flow (native IDP list)
See Documentation
Alternative Flow
See Documentation
Code
- Initial request (and configuration): see onCreate in https://github.com/azuma-healthtech-public/mimoto-examples/blob/main/android-app-auth-code-exchange/app/src/main/java/com/mimoto/example/android/appauthce/MainActivity.java
- Code exchange: see https://github.com/azuma-healthtech-public/mimoto-examples/blob/main/android-app-auth-code-exchange/app/src/main/java/com/mimoto/example/android/appauthce/tasks/ExchangeCodesTask.java
- Token exchange: see onActivityResult in https://github.com/azuma-healthtech-public/mimoto-examples/blob/main/android-app-auth-code-exchange/app/src/main/java/com/mimoto/example/android/appauthce/MainActivity.java
Known Issues
Problem: Deep link does not work
Solution: Make sure to configure your app to receive the deep link (this should be enabled by default). This should be available in app settings -> defaults -> supported web addresses.
Screenshot: Deep Link Configuration