Skip to content

Commit

Permalink
Java Client code example not working (#1881)
Browse files Browse the repository at this point in the history
* Code example not working

Code example is not working because zeebeApi is not defined. By trial and error figured out, that the Zeebe Adress without Port has to be passed here.

* separate variable for audience, added examples

* Applied changes from version_docs to docs: separate variable for audience, added examples

---------

Co-authored-by: jens-hilmar.bradt <jens-hilmar.bradt@syrocon.de>
Co-authored-by: Bernd Ruecker <bernd.ruecker@camunda.com>
Co-authored-by: christinaausley <84338309+christinaausley@users.noreply.github.com>
  • Loading branch information
4 people authored Aug 7, 2023
1 parent 3bf9995 commit 169e852
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions docs/apis-tools/java-client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ If you build a Spring or Spring Boot application, you might want to use [Spring
In Java code, instantiate the client as follows:

```java
private static final String zeebeAddress = "[Zeebe Address]";
private static final String clientId = "[Client ID]";
private static final String zeebeAPI = "[Zeebe Address e.g. f887f1a6-7c2b-48ce-809a-e11e5a6ba31a.dsm-1.zeebe.camunda.io:443]";
private static final String audience = "[Zeebe Token Audience, e.g., zeebe.camunda.io]";
private static final String clientId = "[Client ID, e.g., FmT7K8gVv_FcwiUhc8U-fAJ9wph0Kn~P]";
private static final String clientSecret = "[Client Secret]";
private static final String oAuthAPI = "[OAuth API] ";
private static final String oAuthAPI = "[OAuth API, e.g., https://login.cloud.camunda.io/oauth/token] ";

public static void main(String[] args) {
OAuthCredentialsProvider credentialsProvider =
new OAuthCredentialsProviderBuilder()
.authorizationServerUrl(oAuthAPI)
.audience(zeebeAPI)
.audience(audience)
.clientId(clientId)
.clientSecret(clientSecret)
.build();
Expand Down
9 changes: 5 additions & 4 deletions versioned_docs/version-8.2/apis-tools/java-client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ If you build a Spring or Spring Boot application, you might want to use [Spring
In Java code, instantiate the client as follows:

```java
private static final String zeebeAddress = "[Zeebe Address]";
private static final String clientId = "[Client ID]";
private static final String zeebeAPI = "[Zeebe Address e.g. f887f1a6-7c2b-48ce-809a-e11e5a6ba31a.dsm-1.zeebe.camunda.io:443]";
private static final String audience = "[Zeebe Token Audience, e.g., zeebe.camunda.io]";
private static final String clientId = "[Client ID, e.g., FmT7K8gVv_FcwiUhc8U-fAJ9wph0Kn~P]";
private static final String clientSecret = "[Client Secret]";
private static final String oAuthAPI = "[OAuth API] ";
private static final String oAuthAPI = "[OAuth API, e.g., https://login.cloud.camunda.io/oauth/token] ";

public static void main(String[] args) {
OAuthCredentialsProvider credentialsProvider =
new OAuthCredentialsProviderBuilder()
.authorizationServerUrl(oAuthAPI)
.audience(zeebeAddress)
.audience(audience)
.clientId(clientId)
.clientSecret(clientSecret)
.build();
Expand Down

0 comments on commit 169e852

Please sign in to comment.