Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kinde Java generator

The generator for the Kinde Java SDK.

PRs Welcome Kinde Docs Kinde Community

Overview

This generator creates an SDK in Java that can authenticate to Kinde using the Authorization Code grant or the Authorization Code with PKCE grant via the OAuth 2.0 protocol. It can also access the Kinde Management API using the client credentials grant.

Also, see the SDKs section in Kinde’s contributing guidelines.

Usage

Initial set up

  1. Clone the repository to your machine:

    git clone https://github.com/kinde-oss/kinde-java-generator
  2. Go into the project:

    cd kinde-java-generator
  3. Install the OpenAPI Generator tool:

    https://openapi-generator.tech/docs/installation

SDK generation

Run the following command to generate the SDK:

openapi-generator-cli generate -i kinde.yml -g spring -c kinde-config.yml -o kinde-java-sdk --skip-validate-spec

OR

openapi-generator generate -i kinde.yml -g spring -c kinde-config.yml -o kinde-java-sdk --skip-validate-spec

Note: The API specifications should always point to Kinde's hosted version: https://kinde.com/api/kinde-mgmt-api-specs.yaml. This is set via the -i option in the OpenAPI Generator CLI, for example:

openapi-generator-cli generate -i https://kinde.com/api/kinde-mgmt-api-specs.yaml

The SDK gets outputted to: kinde-java-sdk, which you can enter via:

cd kinde-java-sdk

SDK documentation

Java SDK

Development

Add the following dependency in pom.xml after generation:

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
</dependency>

Afterwards make following changes in pom.xml

1. Locate the <build> section within the pom.xml file.
2. Replace the <build> with following

<build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>test-jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <finalName>kindejava</finalName>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <classifier>exec</classifier>
            </configuration>
        </plugin>
    </plugins>
</build>

Contributing

Please refer to Kinde’s contributing guidelines.

License

By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.

About

OpenAPI generator for Kinde Java SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages