Skip to content

JustAuth

A Java library that adds third-party social login (GitHub, Google, WeChat and many more) to your app.

Stars
17.5k
Forks
2.9k
Licence
MIT
Language
Java
Last update
7 months ago
Type
Library

What it is

JustAuth is a Java library that lets an application offer "log in with another service" buttons, such as GitHub, Google, WeChat or Alipay, without writing each provider's login SDK from scratch. The README says it supports dozens of platforms and provides a simple API for building the authorization URL and handling the callback. Its documentation is mainly in Chinese.

  • Add a "Log in with GitHub" button to a Java web application using the AuthGiteeRequest-style request classes shown in the README
  • Build an authorization URL with authRequest.authorize(state) and handle the redirect with authRequest.login(callback)
  • Store the state value in a cache of your choice, since the README says custom State caching is supported

Great for

  • Java developers adding social or third-party login to a web backend
  • Teams that need to support several Chinese platforms such as WeChat, Alipay, Gitee or DingTalk
  • Developers who want to add a custom OAuth provider through the documented extension mechanism

Not ideal for

  • Non-Java projects, since the library is written for Java and the README only shows Java examples
  • Teams that need only one provider and prefer that provider's official SDK
  • Readers who need English-language documentation, because the README and guide are primarily in Chinese
Step-by-step guide: how to use JustAuthInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Java (README badge shows JDK 1.8+) · Maven or another build tool that can fetch the me.zhyd.oauth JustAuth dependency · An HTTP client library such as hutool-http, httpclient or okhttp

    Add the Maven dependency (copy into pom.xml, replacing {latest-version} with a release number)

    <dependency><groupId>me.zhyd.oauth</groupId><artifactId>JustAuth</artifactId><version>{latest-version}</version></dependency>

    Clone the repository

    git clone https://github.com/justauth/JustAuth
  2. 2

    Run it

    • Register an OAuth application with the provider you want (client ID and secret are required, per the README example)
    • Add the JustAuth dependency and one HTTP client dependency to your project
    • Create an AuthRequest with AuthConfig (clientId, clientSecret, redirectUri) and call authorize(state) to get the login URL
    • After the user returns, call login(callback) with the callback parameters to get the user information
  3. 3

    Get the most out of it

    • Use AuthRequestBuilder with a dynamic AuthConfig lookup if your credentials come from a database or config file, as shown in the README
    • Implement a distributed cache for the state value, since the README describes custom State caching
    • Create a custom AuthSource through the extendSource option for providers not built in
    • Read the project's feature docs on customizing scopes and OAuth platforms at justauth.cn

Downloads

Strengths

  • The README shows a short, consistent API across many providers
  • Supports a broad list of platforms, including many Chinese services
  • Lets developers plug in their own HTTP client (hutool, httpclient or okhttp are shown)

Trade-offs

  • Documentation and community discussion are mostly in Chinese, which may slow English-speaking users
  • The README warns that snapshot builds are not stable and should not be used in production, so you must pin a stable release
  • Provider-specific behavior and credentials still need to be configured and tested for each platform

How it compares

ProjectStarsTypeLevelUpdatedBest for
JustAuth (this)17.5kLibraryintermediate7 months agoJava developers adding social or third-party login to a web backend
hackathon-starter35.3kLibraryintermediate7 days agoDevelopers starting a hackathon project who want a working login system quickly
better-auth30.6kLibraryintermediate5 days agoTypeScript developers who need login and access control in their own app
passport23.5kLibraryintermediate2.2 years agoNode.js and Express developers who need to add login to an existing app
django-allauth10.4kLibraryintermediate6 days agoDjango developers who need signup and login for a web project
API-Security-Checklist23.3kLearning resourcebeginner4 months agoDevelopers reviewing an API design before launch

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.