An Android app that communicates with a non-Google OpenID Connect provider.
Please note:
I’m releasing a library soon with better support and ease of use.
See issue #2 for details and subscribe to it to get notified.
Use Google’s own APIs, if you want to connect to their OpenID provider servers. This project is meant to connect to non-Google providers, which those APIs don’t support.
Since OpenID Connect is basically an extension of OAuth 2, it’s convenient to use readily available libraries as the foundation. This is built upon google-oauth-java-client.
- integration with Android’s
AccountManager
- support for multiple accounts
- login/authorisation via a WebView
- refreshing tokens when needed
- requesting user information
- making authenticated API calls
- heavily commented code
You’ll need to register your app with an OIDC provider and put your configuration data into
Config.java
.
When you launch the app, you’ll see this:
Tapping the button will let you log in to the provider and authorise the app to use your data.
If all goes well:
- the app gets authorisation
- the tokens are saved and associated with an account using Android’s
AccountManager
- the button will indicate that you’ve logged in by displaying your username. (Assuming that the
provider has set
preferred_username
.)
You can add more accounts via Android’s settings. When there are multiple accounts, the app will ask you to choose one of them when logging in.
This project depends on the following libraries. They are fetched automatically via Maven. The last three are for convenience and can probably be written out if needed.
- google-oauth-java-client
- google-api-client-gson
- google-api-client-android
- http-request
This project was originally made to be included in the Ach So! Learning Layers project.
It was developed by Leo Nikkilä at the Learning Environments research group of Aalto University, Finland.
Licensed under the MIT licence. See LICENSING.md.