Based on Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers. AppAuth for Android is a client SDK for communicating with OAuth 2.0 and OpenID Connect providers. It strives to directly map the requests and responses of those specifications, while following the idiomatic style of the implementation language. In addition to mapping the raw protocol flows, convenience methods are available to assist with common tasks like performing an action with fresh tokens.
- For communication with Dynepic playPORTAL through Dynepic playPORTAL API
This app demonstrates the AppAuth library by performing an authorization code
flow with an authorization service Dynepic playPORTAL. The configuration contained in res/raw/auth_config.json
must be modified in order for the app to function. Warnings are supplied when the app is run
with an invalid configuration.
The configuration file MUST contain a JSON object. The following properties can be specified:
-
redirect_uri
(required): The redirect URI to use for receiving the authorization response. This can either be a custom scheme URI (com.example.app:/oauth2redirect/example-provider) or an https app link (https://www.example.com/path). Custom scheme URIs are better supported across all versions of Android, however many authorization server implementations require an https URI. Consult the documentation for your authorization server.The value specified here should match the value specified for
appAuthRedirectScheme
in thebuild.gradle
(Module: app), so that the demo app can capture the response. -
authorization_scope
(required): The scope string to use for the authorization request. For the purposes of the demo, we recommend the value "openid profile email", though any value understood by your authorization server can be used. -
client_id
: The OAuth2 client id used to identify the client to the authorization server. If this property is omitted, or an empty value is provided, dynamic client registration will be attempted using the registration URI in the discovery document referenced bydiscovery_uri
below, or in the valueregistration_endpoint_uri
. -
discovery_uri
: The OpenID Connect discovery URI for your authorization service, if available. If the IDP you wish to test does not support discovery, this value can be omitted or set to an empty string. -
authorization_endpoint_uri
: The authorization endpoint URI for your authorization service. Ifdiscovery_uri
above is not specified, then this value is required. Otherwise, it can be omitted or set to an empty string. -
token_endpoint_uri
: The token endpoint URI for your authorization service. Ifdiscovery_uri
above is not specified, then this value is required. Otherwise, it can be omitted or set to an empty string. -
registration_endpoint_uri
: The dynamic client registration endpoint URI for your authorization service. If client_id and discovery_uri above are not specified, this value MUST be specified. -
https_required
: Whether HTTPS connections are required for registration and token requests. If omitted, this defaults to true. -
more info here
AppAuth supports Android API 16 (Jellybean) and above. Browsers which provide a custom tabs implementation are preferred by the library, but not required. Both Custom URI Schemes (all supported versions of Android) and App Links (Android M / API 23+) can be used with the library.
This project requires the Android SDK for API level 25 (Nougat) to build, though the produced binaries only require API level 16 (Jellybean) to be used. We recommend that you fork and/or clone this repository to make modifications; downloading the source has been known to cause some developers problems.
AppAuth for Android uses Gradle as its build system. In order to build
the library and app binaries, run ./gradlew assemble
.
The library AAR files are output to library/build/outputs/aar
, while the
demo app is output to app/build/outputs/apk
.
In order to run the tests and code analysis, run ./gradlew check
.
In AndroidStudio, File -> New -> Import project. Select the root folder
(the one with the build.gradle
file).