Skip to content

OAuth2 Exchange is a Java library that provides a bunch of functionalities for exchanging authorization code for an access token in OAuth2 Authorization Code Flow.

License

Notifications You must be signed in to change notification settings

mzlnk/oauth2-exchange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuth2 Exchange Library for Java

Licence: MIT Version: 0.1.1 Java : 17 Open Source

About

OAuth2 Exchange is a Java library that provides a bunch of functionalities for exchanging authorization code for an access token in OAuth2 Authorization Code Flow. It consists of templates and ready-to-use implementations for most common authorization providers (like Google or Facebook). The mentioned templates make a proper HTTP call to issue an access token based on provided authorization code. Therefore, you can save your time as you do not need to search through plenty of API docs or to implement a custom HTTP client just to exchange a code for a token - the library do it under the hood via a single method call ;)

According to the OAuth2 overview found on DigitalOcean, the library manages the step 4 (issuing a token from authorization code) and step 5 (receiving token response):

OAuth2 Authorization Code Flow diagram

Apart from the core library which can be used in any Java project, there is also a dedicated starter for Spring Boot provided. It wraps the core library and automatically configures proper templates based on provided credentials via application properties. Therefore, you do not need to bother about declaring necessary beans and other related stuff in your Spring Boot application ;)

You can find out more about implementation details and how to get started with a library on GitHub wiki pages or official Java docs.

Development

The whole project is currently in development, so you can expect plenty of updates over time.

type current version
stable 0.1.1
latest 0.2.0-SNAPSHOT

Supported auth providers

Currently, the oauth2-exchange library provides ready-to-use support for the following auth providers:

Snapshots

Every successfull build from develop branch is automatically deployed in form of snapshot to a public Sonatype repository.

See a bug?

Have noticed a bug in a library? Do not hesitate to report it by creating an GitHub issue!

Want to contribute?

If you want to contribute to the source code:

  • find an issue you want to work on (or create a new one if you want to create something new)
  • fork the project
  • implement the feature/fix (do not forget about test coverage!)
  • create a pull request to develop branch

How to install

Standalone library

Using Maven

If you want to use the core library itself in your Maven project - just include the dependency in your pom.xml file:

<dependency>
    <groupId>io.mzlnk.oauth2.exchange</groupId>
    <artifactId>oauth2-exchange-core</artifactId>
    <version>0.1.1</version>
</dependency>

Using Gradle

If you want to use the core library itself in your Gradle project - just include the dependency build.gradle file:

implementation 'io.mzlnk.oauth2.exchange:oauth2-exchange-core:0.1.1'

Using standalone JAR file

If you want to manually add the core library in your Java project - you can always download the proper JAR file from Releases page.

Starter for Spring Boot

Using Maven

If you want to use the Spring Boot starter in your Maven project - just include the dependency in your pom.xml file:

<dependency>
    <groupId>io.mzlnk.oauth2.exchange</groupId>
    <artifactId>oauth2-exchange-spring-boot-starter</artifactId>
    <version>0.1.1</version>
</dependency>

Using Gradle

If you want to use the core library itself in your Gradle project - just include the dependency build.gradle file:

implementation 'io.mzlnk.oauth2.exchange:oauth2-exchange-spring-boot-starter:0.1.1'

Documentation

If you want to get to know how the whole library works and how to use it in your project - you can check out GitHub wiki pages which include guides and tutorials. There are also official Java docs for core library.

Credits

This starter is under MIT licence so feel free to use it for your personal or commercial use ;)

Created by Marcin Zielonka

About

OAuth2 Exchange is a Java library that provides a bunch of functionalities for exchanging authorization code for an access token in OAuth2 Authorization Code Flow.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published