Skip to content

An OpenID Connect Android demo app showing how to use the HAAPI UI SDK and hardened mobile security

License

Notifications You must be signed in to change notification settings

curityio/android-haapi-ui-sdk-demo

Repository files navigation

Android Application using the HAAPI UI SDK

Quality Availability

An example Android app that uses the Curity Identity Server's Hypermedia API to perform an OIDC flow.
Authentication uses native screens without the need for an external browser.

Getting Started

Start with a local automated deployment to ensure that you understand the technical setup.
You can then apply the same configuration to deployed environments.

1. Deploy the the Curity Identity Server

Ensure that the local computer has these prerequisites:

  • A Docker engine.
  • The envsubst tool, e.g with brew install gettext.
  • The jq tool, e.g with brew install jq.

First copy a license.json file for the Curity Identity Server into the root folder.
Then run a Docker deployment and indicate how connected simulators or devices call the Curity Identity Server.

For example, run the following commands to connect to a macOS computer using its IP address.
Or some older Android emulators might require IDSVR_HOST_NAME to use the special value 10.0.2.2.

export USE_NGROK='false'
export IDSVR_HOST_NAME="$(ipconfig getifaddr en0)"
./start-idsvr.sh

2. View Security Configuration

The Mobile Deployments repository explains further information about the deployed backend infrastructure.
You can view the HAAPI Configuration to understand the settings to apply to deployed environments.

3. Test Basic Logins

Run the app and first test basic logins using an HTML Form authenticator.
Sign in to the deployed environment and use a pre-shipped test user account.

  • Username: demouser
  • Password: Password1

4. Test Native Passkey Logins

Passkeys require hosting of assets documents at a trusted internet HTTPS URL.
You can use ngrok to host assets documents to enable the testing of passkeys logins.

The following example commands deploy the Curity Identity Server with a passkeys configuration.
See the tutorial link at the end of this README to learn more about the ngrok tool.

export USE_NGROK='true'
./start-idsvr.sh

5. Free Deployment Resources

Once you have finished local testing, free all backend resources with the following command:

./stop-idsvr.sh

Application Code

The following links point you to the most essential areas of the example app's source code.

Main Source Files

This app only authenticates the user, then displays the tokens obtained from the authorization server.
See the following source files to understand how that works:

Customizing the Look and Feel

The HAAPI Android customization tutorial explains how to change the default theme.
See also the Developer Documentation for the finer details of customization options.

Resources

See the following tutorials for additional developer information:

Further information

Please visit curity.io for more information about the Curity Identity Server.