Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip
- name: Run integration tests with Maven
- name: Run integration tests with API token auth
if: ${{ github.repository_owner == 'onfido' &&
(github.event_name == 'pull_request' ||
github.event_name == 'release' ||
Expand All @@ -58,6 +58,20 @@ jobs:
ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }}
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }}
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }}
- name: Run integration tests with OAuth client credentials auth
if: ${{ github.repository_owner == 'onfido' &&
(github.event_name == 'pull_request' ||
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch') }}
run: mvn test
env:
ONFIDO_OAUTH_CLIENT_ID: ${{ secrets.ONFIDO_OAUTH_CLIENT_ID }}
ONFIDO_OAUTH_CLIENT_SECRET: ${{ secrets.ONFIDO_OAUTH_CLIENT_SECRET }}
ONFIDO_SAMPLE_APPLICANT_ID: ${{ secrets.ONFIDO_SAMPLE_APPLICANT_ID }}
ONFIDO_SAMPLE_VIDEO_ID_1: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_1 }}
ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }}
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }}
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }}

publish:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "6a19890",
"long_sha": "6a198909828b3935c65b669e44cf2927e84957c0",
"version": "v6.0.1"
"short_sha": "6a36202",
"long_sha": "6a362029f0a58437e8be7185303ef14d3f342feb",
"version": "v6.1.0"
},
"release": "v7.1.0"
"release": "v7.2.0"
}
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.onfido</groupId>
<artifactId>onfido-api-java</artifactId>
<version>7.1.0</version>
<version>7.2.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -66,7 +66,7 @@ Add this dependency to your project's build file:
}

dependencies {
implementation "com.onfido:onfido-api-java:7.1.0"
implementation "com.onfido:onfido-api-java:7.2.0"
}
```

Expand All @@ -80,10 +80,10 @@ mvn clean package

Then manually install the following JARs:

- `target/onfido-api-java-7.1.0.jar`
- `target/onfido-api-java-7.2.0.jar`
- `target/lib/*.jar`

The latest version can be found at <https://search.maven.org/artifact/com.onfido/onfido-api-java/7.1.0/jar>.
The latest version can be found at <https://search.maven.org/artifact/com.onfido/onfido-api-java/7.2.0/jar>.

## Getting Started

Expand All @@ -109,6 +109,20 @@ DefaultApi onfido = new DefaultApi(Configuration.getDefaultApiClient()
.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)))); // Optionally define a connection proxy with the specified host and port
```

You can also authenticate using OAuth2 client credentials instead of an API token:

```java
DefaultApi onfido = new DefaultApi(Configuration.getDefaultApiClient()
.setOAuthCredentials(System.getenv("ONFIDO_OAUTH_CLIENT_ID"),
System.getenv("ONFIDO_OAUTH_CLIENT_SECRET"))
.setRegion(Region.EU) // Supports `EU`, `US` and `CA`
.setConnectTimeout(60_000)
.setReadTimeout(60_000))
.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)))); // Optionally define a connection proxy with the specified host and port
```

The client will automatically exchange credentials for an access token and refresh it when it expires.

NB: By default, the connection and read timeout values are set to 30 seconds. You can adjust these values as shown in the configuration section.

### Making a call to the API
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'

group = 'com.onfido'
version = '7.1.0'
version = '7.2.0'

buildscript {
repositories {
Expand Down Expand Up @@ -113,6 +113,7 @@ dependencies {
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.7'
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.onfido",
name := "onfido-api-java",
version := "7.1.0",
version := "7.2.0",
scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Expand All @@ -16,6 +16,7 @@ lazy val root = (project in file(".")).
"org.apache.commons" % "commons-lang3" % "3.18.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
"io.gsonfire" % "gson-fire" % "1.9.0" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>onfido-api-java</artifactId>
<packaging>jar</packaging>
<name>onfido-api-java</name>
<version>7.1.0</version>
<version>7.2.0</version>
<url>https://documentation.onfido.com</url>
<description>Official Java API client library for the Onfido API</description>
<scm>
Expand Down Expand Up @@ -296,6 +296,11 @@
<artifactId>gson-fire</artifactId>
<version>${gson-fire-version}</version>
</dependency>
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
<artifactId>org.apache.oltu.oauth2.client</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Loading
Loading