We now present a high-level Java API as a type-safe and gentle wrapper for the OpenMetadata backend.
The open-source OpenMetadata SDK for Java simplifies provisioning, managing, and using OpenMetadata resources from the Java application code. \
The OpenMetadata SDK for Java libraries build on top of the underlying OpenMetadata REST API, allows you to use those APIs through familiar Java paradigms. However, you can always use the REST API directly from Java code, if you prefer to do so.
You can find the source code for the OpenMetadata libraries in the [GitHub repository](https://github.com/open-metadata/OpenMetadata/tree/main/openmetadata-clients). As an open-source project, contributions are always welcome!
You can add the below Maven Dependency for OpenMetadata Java Client.
```xml
<dependency>
<groupId>org.open-metadata</groupId>
<artifactId>openmetadata-java-client</artifactId>
<version>0.11.1</version>
</dependency>
```
## Establish OpenMetadata Server Connection
To create OpenMetadata Gateway, you will need to establish a connection with *OpenMetadata Server*. The following
inputs will be needed for the same.
* Host Port: The url on which your instance of OpenMetadata is up and running.
* ApiVersion: The value will be "v1".
* Auth Provider: Provide the auth provider with which you need to configure.
* Security Config: Provide the config for the selected auth provider.
```java
OpenMetadataConnection server = new OpenMetadataConnection();
To set up Okta as the auth provider, the following details should be provided:
* Client ID: Provide the client ID for the service application
* Org URL: It is the same as the ISSUER_URL with v1/token. It is recommended to use a separate authorization server for different applications, rather than using the default authorization server.
* Private Key: Use the Public/Private Key Pair that was generated while [Creating the Service Application](/deployment/security/okta#okta-sso). When copy-pasting the keys ensure that there are no additional codes and that it is a JSON compatible string.
* Email: Enter the email address
* Scopes: Add the details of the scope created in the Authorization Server. Enter the name of the default scope created.
```java
OktaSSOClientConfig oktaSSOClientConfig = new OktaSSOClientConfig();
To set up OpenMetadata as the auth provider, the following details should be provided:
* JWT Token: Provide the JWT Token. For example `eyJraWQiOiJHYjM4OWEtOWY3Ni1nZGpzLWE5Mmo....XN0aW9uLWJvdEBvcGVubWV0YWRhdGEub3JnIn0.Ku_FHGIS3Id3ARusMaXZDYKcq...Ztap9KDU7nZilNT2Bq-o75aIsgKKmtSuVdBTzpFK8aLGLmRp_8J007t-kpcjIW7Qf0l4...dGb0QqhoZin0JA`
```java
OpenMetadataJWTClientConfig openMetadataJWTClientConfig = new OpenMetadataJWTClientConfig();